diff --git a/bin/bundle.js b/bin/bundle.js index 615071f..2edd2d8 100644 --- a/bin/bundle.js +++ b/bin/bundle.js @@ -1,13 +1,49 @@ (function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i 0) { + // scaleX = rect.width / offsetWidth || 1; + // } + // if (offsetHeight > 0) { + // scaleY = rect.height / offsetHeight || 1; + // } + // } + + return { + width: rect.width / scaleX, + height: rect.height / scaleY, + top: rect.top / scaleY, + right: rect.right / scaleX, + bottom: rect.bottom / scaleY, + left: rect.left / scaleX, + x: rect.left / scaleX, + y: rect.top / scaleY + }; +} + function getWindow(node) { if (node == null) { return window; @@ -21,6 +57,16 @@ function getWindow(node) { return node; } +function getWindowScroll(node) { + var win = getWindow(node); + var scrollLeft = win.pageXOffset; + var scrollTop = win.pageYOffset; + return { + scrollLeft: scrollLeft, + scrollTop: scrollTop + }; +} + function isElement(node) { var OwnElement = getWindow(node).Element; return node instanceof OwnElement || node instanceof Element; @@ -41,44 +87,6 @@ function isShadowRoot(node) { return node instanceof OwnElement || node instanceof ShadowRoot; } -var round$1 = Math.round; -function getBoundingClientRect(element, includeScale) { - if (includeScale === void 0) { - includeScale = false; - } - - var rect = element.getBoundingClientRect(); - var scaleX = 1; - var scaleY = 1; - - if (isHTMLElement(element) && includeScale) { - // Fallback to 1 in case both values are `0` - scaleX = rect.width / element.offsetWidth || 1; - scaleY = rect.height / element.offsetHeight || 1; - } - - return { - width: round$1(rect.width / scaleX), - height: round$1(rect.height / scaleY), - top: round$1(rect.top / scaleY), - right: round$1(rect.right / scaleX), - bottom: round$1(rect.bottom / scaleY), - left: round$1(rect.left / scaleX), - x: round$1(rect.left / scaleX), - y: round$1(rect.top / scaleY) - }; -} - -function getWindowScroll(node) { - var win = getWindow(node); - var scrollLeft = win.pageXOffset; - var scrollTop = win.pageYOffset; - return { - scrollLeft: scrollLeft, - scrollTop: scrollTop - }; -} - function getHTMLElementScroll(element) { return { scrollLeft: element.scrollLeft, @@ -144,9 +152,9 @@ function getCompositeRect(elementOrVirtualElement, offsetParent, isFixed) { } var isOffsetParentAnElement = isHTMLElement(offsetParent); - var offsetParentIsScaled = isHTMLElement(offsetParent) && isElementScaled(offsetParent); + isHTMLElement(offsetParent) && isElementScaled(offsetParent); var documentElement = getDocumentElement(offsetParent); - var rect = getBoundingClientRect(elementOrVirtualElement, offsetParentIsScaled); + var rect = getBoundingClientRect(elementOrVirtualElement); var scroll = { scrollLeft: 0, scrollTop: 0 @@ -163,7 +171,7 @@ function getCompositeRect(elementOrVirtualElement, offsetParent, isFixed) { } if (isHTMLElement(offsetParent)) { - offsets = getBoundingClientRect(offsetParent, true); + offsets = getBoundingClientRect(offsetParent); offsets.x += offsetParent.clientLeft; offsets.y += offsetParent.clientTop; } else if (documentElement) { @@ -425,7 +433,10 @@ var MISSING_DEPENDENCY_ERROR = 'Popper: modifier "%s" requires "%s", but "%s" mo var VALID_PROPERTIES = ['name', 'enabled', 'phase', 'fn', 'effect', 'requires', 'options']; function validateModifiers(modifiers) { modifiers.forEach(function (modifier) { - Object.keys(modifier).forEach(function (key) { + [].concat(Object.keys(modifier), VALID_PROPERTIES) // IE11-compatible replacement for `new Set(iterable)` + .filter(function (value, index, self) { + return self.indexOf(value) === index; + }).forEach(function (key) { switch (key) { case 'name': if (typeof modifier.name !== 'string') { @@ -439,6 +450,8 @@ function validateModifiers(modifiers) { console.error(format(INVALID_MODIFIER_ERROR, modifier.name, '"enabled"', '"boolean"', "\"" + String(modifier.enabled) + "\"")); } + break; + case 'phase': if (modifierPhases.indexOf(modifier.phase) < 0) { console.error(format(INVALID_MODIFIER_ERROR, modifier.name, '"phase"', "either " + modifierPhases.join(', '), "\"" + String(modifier.phase) + "\"")); @@ -454,14 +467,14 @@ function validateModifiers(modifiers) { break; case 'effect': - if (typeof modifier.effect !== 'function') { + if (modifier.effect != null && typeof modifier.effect !== 'function') { console.error(format(INVALID_MODIFIER_ERROR, modifier.name, '"effect"', '"function"', "\"" + String(modifier.fn) + "\"")); } break; case 'requires': - if (!Array.isArray(modifier.requires)) { + if (modifier.requires != null && !Array.isArray(modifier.requires)) { console.error(format(INVALID_MODIFIER_ERROR, modifier.name, '"requires"', '"array"', "\"" + String(modifier.requires) + "\"")); } @@ -794,11 +807,10 @@ function detectOverflow(state, options) { padding = _options$padding === void 0 ? 0 : _options$padding; var paddingObject = mergePaddingObject(typeof padding !== 'number' ? padding : expandToHashMap(padding, basePlacements)); var altContext = elementContext === popper ? reference : popper; - var referenceElement = state.elements.reference; var popperRect = state.rects.popper; var element = state.elements[altBoundary ? altContext : elementContext]; var clippingClientRect = getClippingRect(isElement(element) ? element : element.contextElement || getDocumentElement(state.elements.popper), boundary, rootBoundary); - var referenceClientRect = getBoundingClientRect(referenceElement); + var referenceClientRect = getBoundingClientRect(state.elements.reference); var popperOffsets = computeOffsets({ reference: referenceClientRect, element: popperRect, @@ -878,7 +890,8 @@ function popperGenerator(generatorOptions) { var isDestroyed = false; var instance = { state: state, - setOptions: function setOptions(options) { + setOptions: function setOptions(setOptionsAction) { + var options = typeof setOptionsAction === 'function' ? setOptionsAction(state.options) : setOptionsAction; cleanupModifierEffects(); state.options = Object.assign({}, defaultOptions, state.options, options); state.scrollParents = { @@ -1169,6 +1182,7 @@ function mapToStyles(_ref2) { var popper = _ref2.popper, popperRect = _ref2.popperRect, placement = _ref2.placement, + variation = _ref2.variation, offsets = _ref2.offsets, position = _ref2.position, gpuAcceleration = _ref2.gpuAcceleration, @@ -1195,7 +1209,7 @@ function mapToStyles(_ref2) { if (offsetParent === getWindow(popper)) { offsetParent = getDocumentElement(popper); - if (getComputedStyle(offsetParent).position !== 'static') { + if (getComputedStyle(offsetParent).position !== 'static' && position === 'absolute') { heightProp = 'scrollHeight'; widthProp = 'scrollWidth'; } @@ -1204,14 +1218,14 @@ function mapToStyles(_ref2) { offsetParent = offsetParent; - if (placement === top) { + if (placement === top || (placement === left || placement === right) && variation === end) { sideY = bottom; // $FlowFixMe[prop-missing] y -= offsetParent[heightProp] - popperRect.height; y *= gpuAcceleration ? 1 : -1; } - if (placement === left) { + if (placement === left || (placement === top || placement === bottom) && variation === end) { sideX = right; // $FlowFixMe[prop-missing] x -= offsetParent[widthProp] - popperRect.width; @@ -1226,7 +1240,7 @@ function mapToStyles(_ref2) { if (gpuAcceleration) { var _Object$assign; - return Object.assign({}, commonStyles, (_Object$assign = {}, _Object$assign[sideY] = hasY ? '0' : '', _Object$assign[sideX] = hasX ? '0' : '', _Object$assign.transform = (win.devicePixelRatio || 1) < 2 ? "translate(" + x + "px, " + y + "px)" : "translate3d(" + x + "px, " + y + "px, 0)", _Object$assign)); + return Object.assign({}, commonStyles, (_Object$assign = {}, _Object$assign[sideY] = hasY ? '0' : '', _Object$assign[sideX] = hasX ? '0' : '', _Object$assign.transform = (win.devicePixelRatio || 1) <= 1 ? "translate(" + x + "px, " + y + "px)" : "translate3d(" + x + "px, " + y + "px, 0)", _Object$assign)); } return Object.assign({}, commonStyles, (_Object$assign2 = {}, _Object$assign2[sideY] = hasY ? y + "px" : '', _Object$assign2[sideX] = hasX ? x + "px" : '', _Object$assign2.transform = '', _Object$assign2)); @@ -1254,6 +1268,7 @@ function computeStyles(_ref4) { var commonStyles = { placement: getBasePlacement(state.placement), + variation: getVariation(state.placement), popper: state.elements.popper, popperRect: state.rects.popper, gpuAcceleration: gpuAcceleration @@ -1929,7 +1944,7 @@ exports.preventOverflow = preventOverflow$1; }).call(this)}).call(this,require('_process')) -},{"_process":342}],2:[function(require,module,exports){ +},{"_process":341}],2:[function(require,module,exports){ (function (Buffer){(function (){ if ('undefined' === typeof Buffer) { // implicit global @@ -2031,7 +2046,7 @@ if ('undefined' === typeof Buffer) { }()); }).call(this)}).call(this,require("buffer").Buffer) -},{"buffer":116}],3:[function(require,module,exports){ +},{"buffer":110}],3:[function(require,module,exports){ const ADDR_RE = /^\[?([^\]]+)]?:(\d+)$/ // ipv4/ipv6/hostname + port let cache = new Map() @@ -2120,7 +2135,7 @@ Entity.prototype.encode = function encode(data, enc, /* internal */ reporter) { return this._getEncoder(enc).encode(data, reporter); }; -},{"./decoders":13,"./encoders":16,"inherits":249}],6:[function(require,module,exports){ +},{"./decoders":13,"./encoders":16,"inherits":246}],6:[function(require,module,exports){ 'use strict'; const inherits = require('inherits'); @@ -2275,7 +2290,7 @@ EncoderBuffer.prototype.join = function join(out, offset) { return out; }; -},{"../base/reporter":9,"inherits":249,"safer-buffer":387}],7:[function(require,module,exports){ +},{"../base/reporter":9,"inherits":246,"safer-buffer":384}],7:[function(require,module,exports){ 'use strict'; const base = exports; @@ -2925,7 +2940,7 @@ Node.prototype._isPrintstr = function isPrintstr(str) { return /^[A-Za-z0-9 '()+,-./:=?]*$/.test(str); }; -},{"../base/buffer":6,"../base/reporter":9,"minimalistic-assert":287}],9:[function(require,module,exports){ +},{"../base/buffer":6,"../base/reporter":9,"minimalistic-assert":285}],9:[function(require,module,exports){ 'use strict'; const inherits = require('inherits'); @@ -3050,7 +3065,7 @@ ReporterError.prototype.rethrow = function rethrow(msg) { return this; }; -},{"inherits":249}],10:[function(require,module,exports){ +},{"inherits":246}],10:[function(require,module,exports){ 'use strict'; // Helper @@ -3470,7 +3485,7 @@ function derDecodeLen(buf, primitive, fail) { return len; } -},{"../base/buffer":6,"../base/node":8,"../constants/der":10,"bn.js":18,"inherits":249}],13:[function(require,module,exports){ +},{"../base/buffer":6,"../base/node":8,"../constants/der":10,"bn.js":18,"inherits":246}],13:[function(require,module,exports){ 'use strict'; const decoders = exports; @@ -3531,7 +3546,7 @@ PEMDecoder.prototype.decode = function decode(data, options) { return DERDecoder.prototype.decode.call(this, input, options); }; -},{"./der":12,"inherits":249,"safer-buffer":387}],15:[function(require,module,exports){ +},{"./der":12,"inherits":246,"safer-buffer":384}],15:[function(require,module,exports){ 'use strict'; const inherits = require('inherits'); @@ -3828,7 +3843,7 @@ function encodeTag(tag, primitive, cls, reporter) { return res; } -},{"../base/node":8,"../constants/der":10,"inherits":249,"safer-buffer":387}],16:[function(require,module,exports){ +},{"../base/node":8,"../constants/der":10,"inherits":246,"safer-buffer":384}],16:[function(require,module,exports){ 'use strict'; const encoders = exports; @@ -3861,7 +3876,7 @@ PEMEncoder.prototype.encode = function encode(data, options) { return out.join('\n'); }; -},{"./der":15,"inherits":249}],18:[function(require,module,exports){ +},{"./der":15,"inherits":246}],18:[function(require,module,exports){ (function (module, exports) { 'use strict'; @@ -7309,7 +7324,7 @@ PEMEncoder.prototype.encode = function encode(data, options) { }; })(typeof module === 'undefined' || module, this); -},{"buffer":73}],19:[function(require,module,exports){ +},{"buffer":67}],19:[function(require,module,exports){ 'use strict' exports.byteLength = byteLength @@ -7633,7 +7648,7 @@ decode.buffer = function () { module.exports = decode }).call(this)}).call(this,require("buffer").Buffer) -},{"buffer":116}],21:[function(require,module,exports){ +},{"buffer":110}],21:[function(require,module,exports){ (function (Buffer){(function (){ const { getType } = require('./util.js') @@ -7771,7 +7786,7 @@ encode.listSet = function (buffers, data) { module.exports = encode }).call(this)}).call(this,require("buffer").Buffer) -},{"./util.js":24,"buffer":116}],22:[function(require,module,exports){ +},{"./util.js":24,"buffer":110}],22:[function(require,module,exports){ (function (Buffer){(function (){ const { digitCount, getType } = require('./util.js') @@ -7844,7 +7859,7 @@ function encodingLength (value) { module.exports = encodingLength }).call(this)}).call(this,require("buffer").Buffer) -},{"./util.js":24,"buffer":116}],23:[function(require,module,exports){ +},{"./util.js":24,"buffer":110}],23:[function(require,module,exports){ const bencode = module.exports bencode.encode = require('./encode.js') @@ -7885,7 +7900,7 @@ util.getType = function getType (value) { } }).call(this)}).call(this,{"isBuffer":require("../../is-buffer/index.js")}) -},{"../../is-buffer/index.js":251}],25:[function(require,module,exports){ +},{"../../is-buffer/index.js":248}],25:[function(require,module,exports){ module.exports = parseRange module.exports.parse = parseRange module.exports.compose = composeRange @@ -9198,720 +9213,7 @@ class Wire extends stream.Duplex { module.exports = Wire }).call(this)}).call(this,require("buffer").Buffer) -},{"bencode":23,"bitfield":27,"buffer":116,"crypto":165,"debug":29,"randombytes":358,"rc4":376,"readable-stream":46,"simple-sha1":417,"speedometer":442,"unordered-array-remove":493}],29:[function(require,module,exports){ -(function (process){(function (){ -/* eslint-env browser */ - -/** - * This is the web browser implementation of `debug()`. - */ - -exports.formatArgs = formatArgs; -exports.save = save; -exports.load = load; -exports.useColors = useColors; -exports.storage = localstorage(); -exports.destroy = (() => { - let warned = false; - - return () => { - if (!warned) { - warned = true; - console.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.'); - } - }; -})(); - -/** - * Colors. - */ - -exports.colors = [ - '#0000CC', - '#0000FF', - '#0033CC', - '#0033FF', - '#0066CC', - '#0066FF', - '#0099CC', - '#0099FF', - '#00CC00', - '#00CC33', - '#00CC66', - '#00CC99', - '#00CCCC', - '#00CCFF', - '#3300CC', - '#3300FF', - '#3333CC', - '#3333FF', - '#3366CC', - '#3366FF', - '#3399CC', - '#3399FF', - '#33CC00', - '#33CC33', - '#33CC66', - '#33CC99', - '#33CCCC', - '#33CCFF', - '#6600CC', - '#6600FF', - '#6633CC', - '#6633FF', - '#66CC00', - '#66CC33', - '#9900CC', - '#9900FF', - '#9933CC', - '#9933FF', - '#99CC00', - '#99CC33', - '#CC0000', - '#CC0033', - '#CC0066', - '#CC0099', - '#CC00CC', - '#CC00FF', - '#CC3300', - '#CC3333', - '#CC3366', - '#CC3399', - '#CC33CC', - '#CC33FF', - '#CC6600', - '#CC6633', - '#CC9900', - '#CC9933', - '#CCCC00', - '#CCCC33', - '#FF0000', - '#FF0033', - '#FF0066', - '#FF0099', - '#FF00CC', - '#FF00FF', - '#FF3300', - '#FF3333', - '#FF3366', - '#FF3399', - '#FF33CC', - '#FF33FF', - '#FF6600', - '#FF6633', - '#FF9900', - '#FF9933', - '#FFCC00', - '#FFCC33' -]; - -/** - * Currently only WebKit-based Web Inspectors, Firefox >= v31, - * and the Firebug extension (any Firefox version) are known - * to support "%c" CSS customizations. - * - * TODO: add a `localStorage` variable to explicitly enable/disable colors - */ - -// eslint-disable-next-line complexity -function useColors() { - // NB: In an Electron preload script, document will be defined but not fully - // initialized. Since we know we're in Chrome, we'll just detect this case - // explicitly - if (typeof window !== 'undefined' && window.process && (window.process.type === 'renderer' || window.process.__nwjs)) { - return true; - } - - // Internet Explorer and Edge do not support colors. - if (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) { - return false; - } - - // Is webkit? http://stackoverflow.com/a/16459606/376773 - // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632 - return (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) || - // Is firebug? http://stackoverflow.com/a/398120/376773 - (typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) || - // Is firefox >= v31? - // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages - (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31) || - // Double check webkit in userAgent just in case we are in a worker - (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)); -} - -/** - * Colorize log arguments if enabled. - * - * @api public - */ - -function formatArgs(args) { - args[0] = (this.useColors ? '%c' : '') + - this.namespace + - (this.useColors ? ' %c' : ' ') + - args[0] + - (this.useColors ? '%c ' : ' ') + - '+' + module.exports.humanize(this.diff); - - if (!this.useColors) { - return; - } - - const c = 'color: ' + this.color; - args.splice(1, 0, c, 'color: inherit'); - - // The final "%c" is somewhat tricky, because there could be other - // arguments passed either before or after the %c, so we need to - // figure out the correct index to insert the CSS into - let index = 0; - let lastC = 0; - args[0].replace(/%[a-zA-Z%]/g, match => { - if (match === '%%') { - return; - } - index++; - if (match === '%c') { - // We only are interested in the *last* %c - // (the user may have provided their own) - lastC = index; - } - }); - - args.splice(lastC, 0, c); -} - -/** - * Invokes `console.debug()` when available. - * No-op when `console.debug` is not a "function". - * If `console.debug` is not available, falls back - * to `console.log`. - * - * @api public - */ -exports.log = console.debug || console.log || (() => {}); - -/** - * Save `namespaces`. - * - * @param {String} namespaces - * @api private - */ -function save(namespaces) { - try { - if (namespaces) { - exports.storage.setItem('debug', namespaces); - } else { - exports.storage.removeItem('debug'); - } - } catch (error) { - // Swallow - // XXX (@Qix-) should we be logging these? - } -} - -/** - * Load `namespaces`. - * - * @return {String} returns the previously persisted debug modes - * @api private - */ -function load() { - let r; - try { - r = exports.storage.getItem('debug'); - } catch (error) { - // Swallow - // XXX (@Qix-) should we be logging these? - } - - // If debug isn't set in LS, and we're in Electron, try to load $DEBUG - if (!r && typeof process !== 'undefined' && 'env' in process) { - r = process.env.DEBUG; - } - - return r; -} - -/** - * Localstorage attempts to return the localstorage. - * - * This is necessary because safari throws - * when a user disables cookies/localstorage - * and you attempt to access it. - * - * @return {LocalStorage} - * @api private - */ - -function localstorage() { - try { - // TVMLKit (Apple TV JS Runtime) does not have a window object, just localStorage in the global context - // The Browser also has localStorage in the global context. - return localStorage; - } catch (error) { - // Swallow - // XXX (@Qix-) should we be logging these? - } -} - -module.exports = require('./common')(exports); - -const {formatters} = module.exports; - -/** - * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default. - */ - -formatters.j = function (v) { - try { - return JSON.stringify(v); - } catch (error) { - return '[UnexpectedJSONParseError]: ' + error.message; - } -}; - -}).call(this)}).call(this,require('_process')) -},{"./common":30,"_process":342}],30:[function(require,module,exports){ - -/** - * This is the common logic for both the Node.js and web browser - * implementations of `debug()`. - */ - -function setup(env) { - createDebug.debug = createDebug; - createDebug.default = createDebug; - createDebug.coerce = coerce; - createDebug.disable = disable; - createDebug.enable = enable; - createDebug.enabled = enabled; - createDebug.humanize = require('ms'); - createDebug.destroy = destroy; - - Object.keys(env).forEach(key => { - createDebug[key] = env[key]; - }); - - /** - * The currently active debug mode names, and names to skip. - */ - - createDebug.names = []; - createDebug.skips = []; - - /** - * Map of special "%n" handling functions, for the debug "format" argument. - * - * Valid key names are a single, lower or upper-case letter, i.e. "n" and "N". - */ - createDebug.formatters = {}; - - /** - * Selects a color for a debug namespace - * @param {String} namespace The namespace string for the for the debug instance to be colored - * @return {Number|String} An ANSI color code for the given namespace - * @api private - */ - function selectColor(namespace) { - let hash = 0; - - for (let i = 0; i < namespace.length; i++) { - hash = ((hash << 5) - hash) + namespace.charCodeAt(i); - hash |= 0; // Convert to 32bit integer - } - - return createDebug.colors[Math.abs(hash) % createDebug.colors.length]; - } - createDebug.selectColor = selectColor; - - /** - * Create a debugger with the given `namespace`. - * - * @param {String} namespace - * @return {Function} - * @api public - */ - function createDebug(namespace) { - let prevTime; - let enableOverride = null; - let namespacesCache; - let enabledCache; - - function debug(...args) { - // Disabled? - if (!debug.enabled) { - return; - } - - const self = debug; - - // Set `diff` timestamp - const curr = Number(new Date()); - const ms = curr - (prevTime || curr); - self.diff = ms; - self.prev = prevTime; - self.curr = curr; - prevTime = curr; - - args[0] = createDebug.coerce(args[0]); - - if (typeof args[0] !== 'string') { - // Anything else let's inspect with %O - args.unshift('%O'); - } - - // Apply any `formatters` transformations - let index = 0; - args[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => { - // If we encounter an escaped % then don't increase the array index - if (match === '%%') { - return '%'; - } - index++; - const formatter = createDebug.formatters[format]; - if (typeof formatter === 'function') { - const val = args[index]; - match = formatter.call(self, val); - - // Now we need to remove `args[index]` since it's inlined in the `format` - args.splice(index, 1); - index--; - } - return match; - }); - - // Apply env-specific formatting (colors, etc.) - createDebug.formatArgs.call(self, args); - - const logFn = self.log || createDebug.log; - logFn.apply(self, args); - } - - debug.namespace = namespace; - debug.useColors = createDebug.useColors(); - debug.color = createDebug.selectColor(namespace); - debug.extend = extend; - debug.destroy = createDebug.destroy; // XXX Temporary. Will be removed in the next major release. - - Object.defineProperty(debug, 'enabled', { - enumerable: true, - configurable: false, - get: () => { - if (enableOverride !== null) { - return enableOverride; - } - if (namespacesCache !== createDebug.namespaces) { - namespacesCache = createDebug.namespaces; - enabledCache = createDebug.enabled(namespace); - } - - return enabledCache; - }, - set: v => { - enableOverride = v; - } - }); - - // Env-specific initialization logic for debug instances - if (typeof createDebug.init === 'function') { - createDebug.init(debug); - } - - return debug; - } - - function extend(namespace, delimiter) { - const newDebug = createDebug(this.namespace + (typeof delimiter === 'undefined' ? ':' : delimiter) + namespace); - newDebug.log = this.log; - return newDebug; - } - - /** - * Enables a debug mode by namespaces. This can include modes - * separated by a colon and wildcards. - * - * @param {String} namespaces - * @api public - */ - function enable(namespaces) { - createDebug.save(namespaces); - createDebug.namespaces = namespaces; - - createDebug.names = []; - createDebug.skips = []; - - let i; - const split = (typeof namespaces === 'string' ? namespaces : '').split(/[\s,]+/); - const len = split.length; - - for (i = 0; i < len; i++) { - if (!split[i]) { - // ignore empty strings - continue; - } - - namespaces = split[i].replace(/\*/g, '.*?'); - - if (namespaces[0] === '-') { - createDebug.skips.push(new RegExp('^' + namespaces.substr(1) + '$')); - } else { - createDebug.names.push(new RegExp('^' + namespaces + '$')); - } - } - } - - /** - * Disable debug output. - * - * @return {String} namespaces - * @api public - */ - function disable() { - const namespaces = [ - ...createDebug.names.map(toNamespace), - ...createDebug.skips.map(toNamespace).map(namespace => '-' + namespace) - ].join(','); - createDebug.enable(''); - return namespaces; - } - - /** - * Returns true if the given mode name is enabled, false otherwise. - * - * @param {String} name - * @return {Boolean} - * @api public - */ - function enabled(name) { - if (name[name.length - 1] === '*') { - return true; - } - - let i; - let len; - - for (i = 0, len = createDebug.skips.length; i < len; i++) { - if (createDebug.skips[i].test(name)) { - return false; - } - } - - for (i = 0, len = createDebug.names.length; i < len; i++) { - if (createDebug.names[i].test(name)) { - return true; - } - } - - return false; - } - - /** - * Convert regexp to namespace - * - * @param {RegExp} regxep - * @return {String} namespace - * @api private - */ - function toNamespace(regexp) { - return regexp.toString() - .substring(2, regexp.toString().length - 2) - .replace(/\.\*\?$/, '*'); - } - - /** - * Coerce `val`. - * - * @param {Mixed} val - * @return {Mixed} - * @api private - */ - function coerce(val) { - if (val instanceof Error) { - return val.stack || val.message; - } - return val; - } - - /** - * XXX DO NOT USE. This is a temporary stub function. - * XXX It WILL be removed in the next major release. - */ - function destroy() { - console.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.'); - } - - createDebug.enable(createDebug.load()); - - return createDebug; -} - -module.exports = setup; - -},{"ms":31}],31:[function(require,module,exports){ -/** - * Helpers. - */ - -var s = 1000; -var m = s * 60; -var h = m * 60; -var d = h * 24; -var w = d * 7; -var y = d * 365.25; - -/** - * Parse or format the given `val`. - * - * Options: - * - * - `long` verbose formatting [false] - * - * @param {String|Number} val - * @param {Object} [options] - * @throws {Error} throw an error if val is not a non-empty string or a number - * @return {String|Number} - * @api public - */ - -module.exports = function(val, options) { - options = options || {}; - var type = typeof val; - if (type === 'string' && val.length > 0) { - return parse(val); - } else if (type === 'number' && isFinite(val)) { - return options.long ? fmtLong(val) : fmtShort(val); - } - throw new Error( - 'val is not a non-empty string or a valid number. val=' + - JSON.stringify(val) - ); -}; - -/** - * Parse the given `str` and return milliseconds. - * - * @param {String} str - * @return {Number} - * @api private - */ - -function parse(str) { - str = String(str); - if (str.length > 100) { - return; - } - var match = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec( - str - ); - if (!match) { - return; - } - var n = parseFloat(match[1]); - var type = (match[2] || 'ms').toLowerCase(); - switch (type) { - case 'years': - case 'year': - case 'yrs': - case 'yr': - case 'y': - return n * y; - case 'weeks': - case 'week': - case 'w': - return n * w; - case 'days': - case 'day': - case 'd': - return n * d; - case 'hours': - case 'hour': - case 'hrs': - case 'hr': - case 'h': - return n * h; - case 'minutes': - case 'minute': - case 'mins': - case 'min': - case 'm': - return n * m; - case 'seconds': - case 'second': - case 'secs': - case 'sec': - case 's': - return n * s; - case 'milliseconds': - case 'millisecond': - case 'msecs': - case 'msec': - case 'ms': - return n; - default: - return undefined; - } -} - -/** - * Short format for `ms`. - * - * @param {Number} ms - * @return {String} - * @api private - */ - -function fmtShort(ms) { - var msAbs = Math.abs(ms); - if (msAbs >= d) { - return Math.round(ms / d) + 'd'; - } - if (msAbs >= h) { - return Math.round(ms / h) + 'h'; - } - if (msAbs >= m) { - return Math.round(ms / m) + 'm'; - } - if (msAbs >= s) { - return Math.round(ms / s) + 's'; - } - return ms + 'ms'; -} - -/** - * Long format for `ms`. - * - * @param {Number} ms - * @return {String} - * @api private - */ - -function fmtLong(ms) { - var msAbs = Math.abs(ms); - if (msAbs >= d) { - return plural(ms, msAbs, d, 'day'); - } - if (msAbs >= h) { - return plural(ms, msAbs, h, 'hour'); - } - if (msAbs >= m) { - return plural(ms, msAbs, m, 'minute'); - } - if (msAbs >= s) { - return plural(ms, msAbs, s, 'second'); - } - return ms + ' ms'; -} - -/** - * Pluralization helper. - */ - -function plural(ms, msAbs, n, name) { - var isPlural = msAbs >= n * 1.5; - return Math.round(ms / n) + ' ' + name + (isPlural ? 's' : ''); -} - -},{}],32:[function(require,module,exports){ +},{"bencode":23,"bitfield":27,"buffer":110,"crypto":160,"debug":161,"randombytes":357,"rc4":376,"readable-stream":43,"simple-sha1":411,"speedometer":433,"unordered-array-remove":481}],29:[function(require,module,exports){ 'use strict'; function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; } @@ -10040,7 +9342,7 @@ createErrorType('ERR_UNKNOWN_ENCODING', function (arg) { createErrorType('ERR_STREAM_UNSHIFT_AFTER_END_EVENT', 'stream.unshift() after end event'); module.exports.codes = codes; -},{}],33:[function(require,module,exports){ +},{}],30:[function(require,module,exports){ (function (process){(function (){ // Copyright Joyent, Inc. and other Node contributors. // @@ -10182,7 +9484,7 @@ Object.defineProperty(Duplex.prototype, 'destroyed', { } }); }).call(this)}).call(this,require('_process')) -},{"./_stream_readable":35,"./_stream_writable":37,"_process":342,"inherits":249}],34:[function(require,module,exports){ +},{"./_stream_readable":32,"./_stream_writable":34,"_process":341,"inherits":246}],31:[function(require,module,exports){ // Copyright Joyent, Inc. and other Node contributors. // // Permission is hereby granted, free of charge, to any person obtaining a @@ -10222,7 +9524,7 @@ function PassThrough(options) { PassThrough.prototype._transform = function (chunk, encoding, cb) { cb(null, chunk); }; -},{"./_stream_transform":36,"inherits":249}],35:[function(require,module,exports){ +},{"./_stream_transform":33,"inherits":246}],32:[function(require,module,exports){ (function (process,global){(function (){ // Copyright Joyent, Inc. and other Node contributors. // @@ -11349,7 +10651,7 @@ function indexOf(xs, x) { return -1; } }).call(this)}).call(this,require('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{"../errors":32,"./_stream_duplex":33,"./internal/streams/async_iterator":38,"./internal/streams/buffer_list":39,"./internal/streams/destroy":40,"./internal/streams/from":42,"./internal/streams/state":44,"./internal/streams/stream":45,"_process":342,"buffer":116,"events":196,"inherits":249,"string_decoder/":481,"util":73}],36:[function(require,module,exports){ +},{"../errors":29,"./_stream_duplex":30,"./internal/streams/async_iterator":35,"./internal/streams/buffer_list":36,"./internal/streams/destroy":37,"./internal/streams/from":39,"./internal/streams/state":41,"./internal/streams/stream":42,"_process":341,"buffer":110,"events":193,"inherits":246,"string_decoder/":472,"util":67}],33:[function(require,module,exports){ // Copyright Joyent, Inc. and other Node contributors. // // Permission is hereby granted, free of charge, to any person obtaining a @@ -11551,7 +10853,7 @@ function done(stream, er, data) { if (stream._transformState.transforming) throw new ERR_TRANSFORM_ALREADY_TRANSFORMING(); return stream.push(null); } -},{"../errors":32,"./_stream_duplex":33,"inherits":249}],37:[function(require,module,exports){ +},{"../errors":29,"./_stream_duplex":30,"inherits":246}],34:[function(require,module,exports){ (function (process,global){(function (){ // Copyright Joyent, Inc. and other Node contributors. // @@ -12251,7 +11553,7 @@ Writable.prototype._destroy = function (err, cb) { cb(err); }; }).call(this)}).call(this,require('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{"../errors":32,"./_stream_duplex":33,"./internal/streams/destroy":40,"./internal/streams/state":44,"./internal/streams/stream":45,"_process":342,"buffer":116,"inherits":249,"util-deprecate":500}],38:[function(require,module,exports){ +},{"../errors":29,"./_stream_duplex":30,"./internal/streams/destroy":37,"./internal/streams/state":41,"./internal/streams/stream":42,"_process":341,"buffer":110,"inherits":246,"util-deprecate":485}],35:[function(require,module,exports){ (function (process){(function (){ 'use strict'; @@ -12461,7 +11763,7 @@ var createReadableStreamAsyncIterator = function createReadableStreamAsyncIterat module.exports = createReadableStreamAsyncIterator; }).call(this)}).call(this,require('_process')) -},{"./end-of-stream":41,"_process":342}],39:[function(require,module,exports){ +},{"./end-of-stream":38,"_process":341}],36:[function(require,module,exports){ 'use strict'; function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } @@ -12672,7 +11974,7 @@ function () { return BufferList; }(); -},{"buffer":116,"util":73}],40:[function(require,module,exports){ +},{"buffer":110,"util":67}],37:[function(require,module,exports){ (function (process){(function (){ 'use strict'; // undocumented cb() API, needed for core, not for public API @@ -12780,7 +12082,7 @@ module.exports = { errorOrDestroy: errorOrDestroy }; }).call(this)}).call(this,require('_process')) -},{"_process":342}],41:[function(require,module,exports){ +},{"_process":341}],38:[function(require,module,exports){ // Ported from https://github.com/mafintosh/end-of-stream with // permission from the author, Mathias Buus (@mafintosh). 'use strict'; @@ -12885,12 +12187,12 @@ function eos(stream, opts, callback) { } module.exports = eos; -},{"../../../errors":32}],42:[function(require,module,exports){ +},{"../../../errors":29}],39:[function(require,module,exports){ module.exports = function () { throw new Error('Readable.from is not available in the browser') }; -},{}],43:[function(require,module,exports){ +},{}],40:[function(require,module,exports){ // Ported from https://github.com/mafintosh/pump with // permission from the author, Mathias Buus (@mafintosh). 'use strict'; @@ -12988,7 +12290,7 @@ function pipeline() { } module.exports = pipeline; -},{"../../../errors":32,"./end-of-stream":41}],44:[function(require,module,exports){ +},{"../../../errors":29,"./end-of-stream":38}],41:[function(require,module,exports){ 'use strict'; var ERR_INVALID_OPT_VALUE = require('../../../errors').codes.ERR_INVALID_OPT_VALUE; @@ -13016,10 +12318,10 @@ function getHighWaterMark(state, options, duplexKey, isDuplex) { module.exports = { getHighWaterMark: getHighWaterMark }; -},{"../../../errors":32}],45:[function(require,module,exports){ +},{"../../../errors":29}],42:[function(require,module,exports){ module.exports = require('events').EventEmitter; -},{"events":196}],46:[function(require,module,exports){ +},{"events":193}],43:[function(require,module,exports){ exports = module.exports = require('./lib/_stream_readable.js'); exports.Stream = exports; exports.Readable = exports; @@ -13030,7 +12332,7 @@ exports.PassThrough = require('./lib/_stream_passthrough.js'); exports.finished = require('./lib/internal/streams/end-of-stream.js'); exports.pipeline = require('./lib/internal/streams/pipeline.js'); -},{"./lib/_stream_duplex.js":33,"./lib/_stream_passthrough.js":34,"./lib/_stream_readable.js":35,"./lib/_stream_transform.js":36,"./lib/_stream_writable.js":37,"./lib/internal/streams/end-of-stream.js":41,"./lib/internal/streams/pipeline.js":43}],47:[function(require,module,exports){ +},{"./lib/_stream_duplex.js":30,"./lib/_stream_passthrough.js":31,"./lib/_stream_readable.js":32,"./lib/_stream_transform.js":33,"./lib/_stream_writable.js":34,"./lib/internal/streams/end-of-stream.js":38,"./lib/internal/streams/pipeline.js":40}],44:[function(require,module,exports){ (function (process,Buffer){(function (){ const debug = require('debug')('bittorrent-tracker:client') const EventEmitter = require('events') @@ -13058,6 +12360,7 @@ const WebSocketTracker = require('./lib/client/websocket-tracker') * @param {number} opts.rtcConfig RTCPeerConnection configuration object * @param {number} opts.userAgent User-Agent header for http requests * @param {number} opts.wrtc custom webrtc impl (useful in node.js) + * @param {object} opts.proxyOpts proxy options (useful in node.js) */ class Client extends EventEmitter { constructor (opts = {}) { @@ -13088,6 +12391,7 @@ class Client extends EventEmitter { this._getAnnounceOpts = opts.getAnnounceOpts this._rtcConfig = opts.rtcConfig this._userAgent = opts.userAgent + this._proxyOpts = opts.proxyOpts // Support lazy 'wrtc' module initialization // See: https://github.com/webtorrent/webtorrent-hybrid/issues/46 @@ -13324,7 +12628,7 @@ Client.scrape = (opts, cb) => { module.exports = Client }).call(this)}).call(this,require('_process'),require("buffer").Buffer) -},{"./lib/client/http-tracker":73,"./lib/client/udp-tracker":73,"./lib/client/websocket-tracker":49,"./lib/common":50,"_process":342,"buffer":116,"debug":51,"events":196,"once":327,"queue-microtask":355,"run-parallel":384,"simple-peer":398}],48:[function(require,module,exports){ +},{"./lib/client/http-tracker":67,"./lib/client/udp-tracker":67,"./lib/client/websocket-tracker":46,"./lib/common":47,"_process":341,"buffer":110,"debug":161,"events":193,"once":326,"queue-microtask":354,"run-parallel":381,"simple-peer":395}],45:[function(require,module,exports){ const EventEmitter = require('events') class Tracker extends EventEmitter { @@ -13354,11 +12658,13 @@ class Tracker extends EventEmitter { module.exports = Tracker -},{"events":196}],49:[function(require,module,exports){ +},{"events":193}],46:[function(require,module,exports){ +const clone = require('clone') const debug = require('debug')('bittorrent-tracker:websocket-tracker') const Peer = require('simple-peer') const randombytes = require('randombytes') const Socket = require('simple-websocket') +const Socks = require('socks') const common = require('../common') const Tracker = require('./tracker') @@ -13533,7 +12839,15 @@ class WebSocketTracker extends Tracker { this._onSocketConnectBound() } } else { - this.socket = socketPool[this.announceUrl] = new Socket(this.announceUrl) + const parsedUrl = new URL(this.announceUrl) + let agent + if (this.client._proxyOpts) { + agent = parsedUrl.protocol === 'wss:' ? this.client._proxyOpts.httpsAgent : this.client._proxyOpts.httpAgent + if (!agent && this.client._proxyOpts.socksProxy) { + agent = new Socks.Agent(clone(this.client._proxyOpts.socksProxy), (parsedUrl.protocol === 'wss:')) + } + } + this.socket = socketPool[this.announceUrl] = new Socket({ url: this.announceUrl, agent }) this.socket.consumers = 1 this.socket.once('connect', this._onSocketConnectBound) } @@ -13788,7 +13102,7 @@ function noop () {} module.exports = WebSocketTracker -},{"../common":50,"./tracker":48,"debug":51,"randombytes":358,"simple-peer":398,"simple-websocket":419}],50:[function(require,module,exports){ +},{"../common":47,"./tracker":45,"clone":136,"debug":161,"randombytes":357,"simple-peer":395,"simple-websocket":413,"socks":67}],47:[function(require,module,exports){ (function (Buffer){(function (){ /** * Functions/constants needed by both the client and server. @@ -13841,13 +13155,7 @@ const config = require('./common-node') Object.assign(exports, config) }).call(this)}).call(this,require("buffer").Buffer) -},{"./common-node":73,"buffer":116}],51:[function(require,module,exports){ -arguments[4][29][0].apply(exports,arguments) -},{"./common":52,"_process":342,"dup":29}],52:[function(require,module,exports){ -arguments[4][30][0].apply(exports,arguments) -},{"dup":30,"ms":53}],53:[function(require,module,exports){ -arguments[4][31][0].apply(exports,arguments) -},{"dup":31}],54:[function(require,module,exports){ +},{"./common-node":67,"buffer":110}],48:[function(require,module,exports){ (function (Buffer){(function (){ /*! blob-to-buffer. MIT License. Feross Aboukhadijeh */ /* global Blob, FileReader */ @@ -13873,7 +13181,7 @@ module.exports = function blobToBuffer (blob, cb) { } }).call(this)}).call(this,require("buffer").Buffer) -},{"buffer":116}],55:[function(require,module,exports){ +},{"buffer":110}],49:[function(require,module,exports){ (function (Buffer){(function (){ const { Transform } = require('readable-stream') @@ -13946,37 +13254,37 @@ class Block extends Transform { module.exports = Block }).call(this)}).call(this,require("buffer").Buffer) -},{"buffer":116,"readable-stream":70}],56:[function(require,module,exports){ +},{"buffer":110,"readable-stream":64}],50:[function(require,module,exports){ +arguments[4][29][0].apply(exports,arguments) +},{"dup":29}],51:[function(require,module,exports){ +arguments[4][30][0].apply(exports,arguments) +},{"./_stream_readable":53,"./_stream_writable":55,"_process":341,"dup":30,"inherits":246}],52:[function(require,module,exports){ +arguments[4][31][0].apply(exports,arguments) +},{"./_stream_transform":54,"dup":31,"inherits":246}],53:[function(require,module,exports){ arguments[4][32][0].apply(exports,arguments) -},{"dup":32}],57:[function(require,module,exports){ +},{"../errors":50,"./_stream_duplex":51,"./internal/streams/async_iterator":56,"./internal/streams/buffer_list":57,"./internal/streams/destroy":58,"./internal/streams/from":60,"./internal/streams/state":62,"./internal/streams/stream":63,"_process":341,"buffer":110,"dup":32,"events":193,"inherits":246,"string_decoder/":472,"util":67}],54:[function(require,module,exports){ arguments[4][33][0].apply(exports,arguments) -},{"./_stream_readable":59,"./_stream_writable":61,"_process":342,"dup":33,"inherits":249}],58:[function(require,module,exports){ +},{"../errors":50,"./_stream_duplex":51,"dup":33,"inherits":246}],55:[function(require,module,exports){ arguments[4][34][0].apply(exports,arguments) -},{"./_stream_transform":60,"dup":34,"inherits":249}],59:[function(require,module,exports){ +},{"../errors":50,"./_stream_duplex":51,"./internal/streams/destroy":58,"./internal/streams/state":62,"./internal/streams/stream":63,"_process":341,"buffer":110,"dup":34,"inherits":246,"util-deprecate":485}],56:[function(require,module,exports){ arguments[4][35][0].apply(exports,arguments) -},{"../errors":56,"./_stream_duplex":57,"./internal/streams/async_iterator":62,"./internal/streams/buffer_list":63,"./internal/streams/destroy":64,"./internal/streams/from":66,"./internal/streams/state":68,"./internal/streams/stream":69,"_process":342,"buffer":116,"dup":35,"events":196,"inherits":249,"string_decoder/":481,"util":73}],60:[function(require,module,exports){ +},{"./end-of-stream":59,"_process":341,"dup":35}],57:[function(require,module,exports){ arguments[4][36][0].apply(exports,arguments) -},{"../errors":56,"./_stream_duplex":57,"dup":36,"inherits":249}],61:[function(require,module,exports){ +},{"buffer":110,"dup":36,"util":67}],58:[function(require,module,exports){ arguments[4][37][0].apply(exports,arguments) -},{"../errors":56,"./_stream_duplex":57,"./internal/streams/destroy":64,"./internal/streams/state":68,"./internal/streams/stream":69,"_process":342,"buffer":116,"dup":37,"inherits":249,"util-deprecate":500}],62:[function(require,module,exports){ +},{"_process":341,"dup":37}],59:[function(require,module,exports){ arguments[4][38][0].apply(exports,arguments) -},{"./end-of-stream":65,"_process":342,"dup":38}],63:[function(require,module,exports){ +},{"../../../errors":50,"dup":38}],60:[function(require,module,exports){ arguments[4][39][0].apply(exports,arguments) -},{"buffer":116,"dup":39,"util":73}],64:[function(require,module,exports){ +},{"dup":39}],61:[function(require,module,exports){ arguments[4][40][0].apply(exports,arguments) -},{"_process":342,"dup":40}],65:[function(require,module,exports){ +},{"../../../errors":50,"./end-of-stream":59,"dup":40}],62:[function(require,module,exports){ arguments[4][41][0].apply(exports,arguments) -},{"../../../errors":56,"dup":41}],66:[function(require,module,exports){ +},{"../../../errors":50,"dup":41}],63:[function(require,module,exports){ arguments[4][42][0].apply(exports,arguments) -},{"dup":42}],67:[function(require,module,exports){ +},{"dup":42,"events":193}],64:[function(require,module,exports){ arguments[4][43][0].apply(exports,arguments) -},{"../../../errors":56,"./end-of-stream":65,"dup":43}],68:[function(require,module,exports){ -arguments[4][44][0].apply(exports,arguments) -},{"../../../errors":56,"dup":44}],69:[function(require,module,exports){ -arguments[4][45][0].apply(exports,arguments) -},{"dup":45,"events":196}],70:[function(require,module,exports){ -arguments[4][46][0].apply(exports,arguments) -},{"./lib/_stream_duplex.js":57,"./lib/_stream_passthrough.js":58,"./lib/_stream_readable.js":59,"./lib/_stream_transform.js":60,"./lib/_stream_writable.js":61,"./lib/internal/streams/end-of-stream.js":65,"./lib/internal/streams/pipeline.js":67,"dup":46}],71:[function(require,module,exports){ +},{"./lib/_stream_duplex.js":51,"./lib/_stream_passthrough.js":52,"./lib/_stream_readable.js":53,"./lib/_stream_transform.js":54,"./lib/_stream_writable.js":55,"./lib/internal/streams/end-of-stream.js":59,"./lib/internal/streams/pipeline.js":61,"dup":43}],65:[function(require,module,exports){ (function (module, exports) { 'use strict'; @@ -17525,7 +16833,7 @@ arguments[4][46][0].apply(exports,arguments) }; })(typeof module === 'undefined' || module, this); -},{"buffer":73}],72:[function(require,module,exports){ +},{"buffer":67}],66:[function(require,module,exports){ var r; module.exports = function rand(len) { @@ -17592,9 +16900,9 @@ if (typeof self === 'object') { } } -},{"crypto":73}],73:[function(require,module,exports){ +},{"crypto":67}],67:[function(require,module,exports){ -},{}],74:[function(require,module,exports){ +},{}],68:[function(require,module,exports){ // based on the aes implimentation in triple sec // https://github.com/keybase/triplesec // which is in turn based on the one from crypto-js @@ -17824,7 +17132,7 @@ AES.prototype.scrub = function () { module.exports.AES = AES -},{"safe-buffer":386}],75:[function(require,module,exports){ +},{"safe-buffer":383}],69:[function(require,module,exports){ var aes = require('./aes') var Buffer = require('safe-buffer').Buffer var Transform = require('cipher-base') @@ -17943,7 +17251,7 @@ StreamCipher.prototype.setAAD = function setAAD (buf) { module.exports = StreamCipher -},{"./aes":74,"./ghash":79,"./incr32":80,"buffer-xor":120,"cipher-base":140,"inherits":249,"safe-buffer":386}],76:[function(require,module,exports){ +},{"./aes":68,"./ghash":73,"./incr32":74,"buffer-xor":114,"cipher-base":134,"inherits":246,"safe-buffer":383}],70:[function(require,module,exports){ var ciphers = require('./encrypter') var deciphers = require('./decrypter') var modes = require('./modes/list.json') @@ -17958,7 +17266,7 @@ exports.createDecipher = exports.Decipher = deciphers.createDecipher exports.createDecipheriv = exports.Decipheriv = deciphers.createDecipheriv exports.listCiphers = exports.getCiphers = getCiphers -},{"./decrypter":77,"./encrypter":78,"./modes/list.json":88}],77:[function(require,module,exports){ +},{"./decrypter":71,"./encrypter":72,"./modes/list.json":82}],71:[function(require,module,exports){ var AuthCipher = require('./authCipher') var Buffer = require('safe-buffer').Buffer var MODES = require('./modes') @@ -18084,7 +17392,7 @@ function createDecipher (suite, password) { exports.createDecipher = createDecipher exports.createDecipheriv = createDecipheriv -},{"./aes":74,"./authCipher":75,"./modes":87,"./streamCipher":90,"cipher-base":140,"evp_bytestokey":197,"inherits":249,"safe-buffer":386}],78:[function(require,module,exports){ +},{"./aes":68,"./authCipher":69,"./modes":81,"./streamCipher":84,"cipher-base":134,"evp_bytestokey":194,"inherits":246,"safe-buffer":383}],72:[function(require,module,exports){ var MODES = require('./modes') var AuthCipher = require('./authCipher') var Buffer = require('safe-buffer').Buffer @@ -18200,7 +17508,7 @@ function createCipher (suite, password) { exports.createCipheriv = createCipheriv exports.createCipher = createCipher -},{"./aes":74,"./authCipher":75,"./modes":87,"./streamCipher":90,"cipher-base":140,"evp_bytestokey":197,"inherits":249,"safe-buffer":386}],79:[function(require,module,exports){ +},{"./aes":68,"./authCipher":69,"./modes":81,"./streamCipher":84,"cipher-base":134,"evp_bytestokey":194,"inherits":246,"safe-buffer":383}],73:[function(require,module,exports){ var Buffer = require('safe-buffer').Buffer var ZEROES = Buffer.alloc(16, 0) @@ -18291,7 +17599,7 @@ GHASH.prototype.final = function (abl, bl) { module.exports = GHASH -},{"safe-buffer":386}],80:[function(require,module,exports){ +},{"safe-buffer":383}],74:[function(require,module,exports){ function incr32 (iv) { var len = iv.length var item @@ -18308,7 +17616,7 @@ function incr32 (iv) { } module.exports = incr32 -},{}],81:[function(require,module,exports){ +},{}],75:[function(require,module,exports){ var xor = require('buffer-xor') exports.encrypt = function (self, block) { @@ -18327,7 +17635,7 @@ exports.decrypt = function (self, block) { return xor(out, pad) } -},{"buffer-xor":120}],82:[function(require,module,exports){ +},{"buffer-xor":114}],76:[function(require,module,exports){ var Buffer = require('safe-buffer').Buffer var xor = require('buffer-xor') @@ -18362,7 +17670,7 @@ exports.encrypt = function (self, data, decrypt) { return out } -},{"buffer-xor":120,"safe-buffer":386}],83:[function(require,module,exports){ +},{"buffer-xor":114,"safe-buffer":383}],77:[function(require,module,exports){ var Buffer = require('safe-buffer').Buffer function encryptByte (self, byteParam, decrypt) { @@ -18406,7 +17714,7 @@ exports.encrypt = function (self, chunk, decrypt) { return out } -},{"safe-buffer":386}],84:[function(require,module,exports){ +},{"safe-buffer":383}],78:[function(require,module,exports){ var Buffer = require('safe-buffer').Buffer function encryptByte (self, byteParam, decrypt) { @@ -18433,7 +17741,7 @@ exports.encrypt = function (self, chunk, decrypt) { return out } -},{"safe-buffer":386}],85:[function(require,module,exports){ +},{"safe-buffer":383}],79:[function(require,module,exports){ var xor = require('buffer-xor') var Buffer = require('safe-buffer').Buffer var incr32 = require('../incr32') @@ -18465,7 +17773,7 @@ exports.encrypt = function (self, chunk) { return xor(chunk, pad) } -},{"../incr32":80,"buffer-xor":120,"safe-buffer":386}],86:[function(require,module,exports){ +},{"../incr32":74,"buffer-xor":114,"safe-buffer":383}],80:[function(require,module,exports){ exports.encrypt = function (self, block) { return self._cipher.encryptBlock(block) } @@ -18474,7 +17782,7 @@ exports.decrypt = function (self, block) { return self._cipher.decryptBlock(block) } -},{}],87:[function(require,module,exports){ +},{}],81:[function(require,module,exports){ var modeModules = { ECB: require('./ecb'), CBC: require('./cbc'), @@ -18494,7 +17802,7 @@ for (var key in modes) { module.exports = modes -},{"./cbc":81,"./cfb":82,"./cfb1":83,"./cfb8":84,"./ctr":85,"./ecb":86,"./list.json":88,"./ofb":89}],88:[function(require,module,exports){ +},{"./cbc":75,"./cfb":76,"./cfb1":77,"./cfb8":78,"./ctr":79,"./ecb":80,"./list.json":82,"./ofb":83}],82:[function(require,module,exports){ module.exports={ "aes-128-ecb": { "cipher": "AES", @@ -18687,7 +17995,7 @@ module.exports={ } } -},{}],89:[function(require,module,exports){ +},{}],83:[function(require,module,exports){ (function (Buffer){(function (){ var xor = require('buffer-xor') @@ -18707,7 +18015,7 @@ exports.encrypt = function (self, chunk) { } }).call(this)}).call(this,require("buffer").Buffer) -},{"buffer":116,"buffer-xor":120}],90:[function(require,module,exports){ +},{"buffer":110,"buffer-xor":114}],84:[function(require,module,exports){ var aes = require('./aes') var Buffer = require('safe-buffer').Buffer var Transform = require('cipher-base') @@ -18736,7 +18044,7 @@ StreamCipher.prototype._final = function () { module.exports = StreamCipher -},{"./aes":74,"cipher-base":140,"inherits":249,"safe-buffer":386}],91:[function(require,module,exports){ +},{"./aes":68,"cipher-base":134,"inherits":246,"safe-buffer":383}],85:[function(require,module,exports){ var DES = require('browserify-des') var aes = require('browserify-aes/browser') var aesModes = require('browserify-aes/modes') @@ -18805,7 +18113,7 @@ exports.createDecipher = exports.Decipher = createDecipher exports.createDecipheriv = exports.Decipheriv = createDecipheriv exports.listCiphers = exports.getCiphers = getCiphers -},{"browserify-aes/browser":76,"browserify-aes/modes":87,"browserify-des":92,"browserify-des/modes":93,"evp_bytestokey":197}],92:[function(require,module,exports){ +},{"browserify-aes/browser":70,"browserify-aes/modes":81,"browserify-des":86,"browserify-des/modes":87,"evp_bytestokey":194}],86:[function(require,module,exports){ var CipherBase = require('cipher-base') var des = require('des.js') var inherits = require('inherits') @@ -18857,7 +18165,7 @@ DES.prototype._final = function () { return Buffer.from(this._des.final()) } -},{"cipher-base":140,"des.js":166,"inherits":249,"safe-buffer":386}],93:[function(require,module,exports){ +},{"cipher-base":134,"des.js":163,"inherits":246,"safe-buffer":383}],87:[function(require,module,exports){ exports['des-ecb'] = { key: 8, iv: 0 @@ -18883,7 +18191,7 @@ exports['des-ede'] = { iv: 0 } -},{}],94:[function(require,module,exports){ +},{}],88:[function(require,module,exports){ (function (Buffer){(function (){ var BN = require('bn.js') var randomBytes = require('randombytes') @@ -18922,10 +18230,10 @@ crt.getr = getr module.exports = crt }).call(this)}).call(this,require("buffer").Buffer) -},{"bn.js":71,"buffer":116,"randombytes":358}],95:[function(require,module,exports){ +},{"bn.js":65,"buffer":110,"randombytes":357}],89:[function(require,module,exports){ module.exports = require('./browser/algorithms.json') -},{"./browser/algorithms.json":96}],96:[function(require,module,exports){ +},{"./browser/algorithms.json":90}],90:[function(require,module,exports){ module.exports={ "sha224WithRSAEncryption": { "sign": "rsa", @@ -19079,7 +18387,7 @@ module.exports={ } } -},{}],97:[function(require,module,exports){ +},{}],91:[function(require,module,exports){ module.exports={ "1.3.132.0.10": "secp256k1", "1.3.132.0.33": "p224", @@ -19089,7 +18397,7 @@ module.exports={ "1.3.132.0.35": "p521" } -},{}],98:[function(require,module,exports){ +},{}],92:[function(require,module,exports){ var Buffer = require('safe-buffer').Buffer var createHash = require('create-hash') var stream = require('readable-stream') @@ -19183,7 +18491,7 @@ module.exports = { createVerify: createVerify } -},{"./algorithms.json":96,"./sign":99,"./verify":100,"create-hash":145,"inherits":249,"readable-stream":115,"safe-buffer":386}],99:[function(require,module,exports){ +},{"./algorithms.json":90,"./sign":93,"./verify":94,"create-hash":140,"inherits":246,"readable-stream":109,"safe-buffer":383}],93:[function(require,module,exports){ // much of this based on https://github.com/indutny/self-signed/blob/gh-pages/lib/rsa.js var Buffer = require('safe-buffer').Buffer var createHmac = require('create-hmac') @@ -19328,7 +18636,7 @@ module.exports = sign module.exports.getKey = getKey module.exports.makeKey = makeKey -},{"./curves.json":97,"bn.js":71,"browserify-rsa":94,"create-hmac":147,"elliptic":177,"parse-asn1":332,"safe-buffer":386}],100:[function(require,module,exports){ +},{"./curves.json":91,"bn.js":65,"browserify-rsa":88,"create-hmac":142,"elliptic":174,"parse-asn1":331,"safe-buffer":383}],94:[function(require,module,exports){ // much of this based on https://github.com/indutny/self-signed/blob/gh-pages/lib/rsa.js var Buffer = require('safe-buffer').Buffer var BN = require('bn.js') @@ -19414,37 +18722,37 @@ function checkValue (b, q) { module.exports = verify -},{"./curves.json":97,"bn.js":71,"elliptic":177,"parse-asn1":332,"safe-buffer":386}],101:[function(require,module,exports){ +},{"./curves.json":91,"bn.js":65,"elliptic":174,"parse-asn1":331,"safe-buffer":383}],95:[function(require,module,exports){ +arguments[4][29][0].apply(exports,arguments) +},{"dup":29}],96:[function(require,module,exports){ +arguments[4][30][0].apply(exports,arguments) +},{"./_stream_readable":98,"./_stream_writable":100,"_process":341,"dup":30,"inherits":246}],97:[function(require,module,exports){ +arguments[4][31][0].apply(exports,arguments) +},{"./_stream_transform":99,"dup":31,"inherits":246}],98:[function(require,module,exports){ arguments[4][32][0].apply(exports,arguments) -},{"dup":32}],102:[function(require,module,exports){ +},{"../errors":95,"./_stream_duplex":96,"./internal/streams/async_iterator":101,"./internal/streams/buffer_list":102,"./internal/streams/destroy":103,"./internal/streams/from":105,"./internal/streams/state":107,"./internal/streams/stream":108,"_process":341,"buffer":110,"dup":32,"events":193,"inherits":246,"string_decoder/":472,"util":67}],99:[function(require,module,exports){ arguments[4][33][0].apply(exports,arguments) -},{"./_stream_readable":104,"./_stream_writable":106,"_process":342,"dup":33,"inherits":249}],103:[function(require,module,exports){ +},{"../errors":95,"./_stream_duplex":96,"dup":33,"inherits":246}],100:[function(require,module,exports){ arguments[4][34][0].apply(exports,arguments) -},{"./_stream_transform":105,"dup":34,"inherits":249}],104:[function(require,module,exports){ +},{"../errors":95,"./_stream_duplex":96,"./internal/streams/destroy":103,"./internal/streams/state":107,"./internal/streams/stream":108,"_process":341,"buffer":110,"dup":34,"inherits":246,"util-deprecate":485}],101:[function(require,module,exports){ arguments[4][35][0].apply(exports,arguments) -},{"../errors":101,"./_stream_duplex":102,"./internal/streams/async_iterator":107,"./internal/streams/buffer_list":108,"./internal/streams/destroy":109,"./internal/streams/from":111,"./internal/streams/state":113,"./internal/streams/stream":114,"_process":342,"buffer":116,"dup":35,"events":196,"inherits":249,"string_decoder/":481,"util":73}],105:[function(require,module,exports){ +},{"./end-of-stream":104,"_process":341,"dup":35}],102:[function(require,module,exports){ arguments[4][36][0].apply(exports,arguments) -},{"../errors":101,"./_stream_duplex":102,"dup":36,"inherits":249}],106:[function(require,module,exports){ +},{"buffer":110,"dup":36,"util":67}],103:[function(require,module,exports){ arguments[4][37][0].apply(exports,arguments) -},{"../errors":101,"./_stream_duplex":102,"./internal/streams/destroy":109,"./internal/streams/state":113,"./internal/streams/stream":114,"_process":342,"buffer":116,"dup":37,"inherits":249,"util-deprecate":500}],107:[function(require,module,exports){ +},{"_process":341,"dup":37}],104:[function(require,module,exports){ arguments[4][38][0].apply(exports,arguments) -},{"./end-of-stream":110,"_process":342,"dup":38}],108:[function(require,module,exports){ +},{"../../../errors":95,"dup":38}],105:[function(require,module,exports){ arguments[4][39][0].apply(exports,arguments) -},{"buffer":116,"dup":39,"util":73}],109:[function(require,module,exports){ +},{"dup":39}],106:[function(require,module,exports){ arguments[4][40][0].apply(exports,arguments) -},{"_process":342,"dup":40}],110:[function(require,module,exports){ +},{"../../../errors":95,"./end-of-stream":104,"dup":40}],107:[function(require,module,exports){ arguments[4][41][0].apply(exports,arguments) -},{"../../../errors":101,"dup":41}],111:[function(require,module,exports){ +},{"../../../errors":95,"dup":41}],108:[function(require,module,exports){ arguments[4][42][0].apply(exports,arguments) -},{"dup":42}],112:[function(require,module,exports){ +},{"dup":42,"events":193}],109:[function(require,module,exports){ arguments[4][43][0].apply(exports,arguments) -},{"../../../errors":101,"./end-of-stream":110,"dup":43}],113:[function(require,module,exports){ -arguments[4][44][0].apply(exports,arguments) -},{"../../../errors":101,"dup":44}],114:[function(require,module,exports){ -arguments[4][45][0].apply(exports,arguments) -},{"dup":45,"events":196}],115:[function(require,module,exports){ -arguments[4][46][0].apply(exports,arguments) -},{"./lib/_stream_duplex.js":102,"./lib/_stream_passthrough.js":103,"./lib/_stream_readable.js":104,"./lib/_stream_transform.js":105,"./lib/_stream_writable.js":106,"./lib/internal/streams/end-of-stream.js":110,"./lib/internal/streams/pipeline.js":112,"dup":46}],116:[function(require,module,exports){ +},{"./lib/_stream_duplex.js":96,"./lib/_stream_passthrough.js":97,"./lib/_stream_readable.js":98,"./lib/_stream_transform.js":99,"./lib/_stream_writable.js":100,"./lib/internal/streams/end-of-stream.js":104,"./lib/internal/streams/pipeline.js":106,"dup":43}],110:[function(require,module,exports){ (function (Buffer){(function (){ /*! * The buffer module from node.js, for the browser. @@ -21225,7 +20533,7 @@ function numberIsNaN (obj) { } }).call(this)}).call(this,require("buffer").Buffer) -},{"base64-js":19,"buffer":116,"ieee754":247}],117:[function(require,module,exports){ +},{"base64-js":19,"buffer":110,"ieee754":244}],111:[function(require,module,exports){ (function (Buffer){(function (){ function allocUnsafe (size) { if (typeof size !== 'number') { @@ -21246,7 +20554,7 @@ function allocUnsafe (size) { module.exports = allocUnsafe }).call(this)}).call(this,require("buffer").Buffer) -},{"buffer":116}],118:[function(require,module,exports){ +},{"buffer":110}],112:[function(require,module,exports){ (function (Buffer){(function (){ var bufferFill = require('buffer-fill') var allocUnsafe = require('buffer-alloc-unsafe') @@ -21282,7 +20590,7 @@ module.exports = function alloc (size, fill, encoding) { } }).call(this)}).call(this,require("buffer").Buffer) -},{"buffer":116,"buffer-alloc-unsafe":117,"buffer-fill":119}],119:[function(require,module,exports){ +},{"buffer":110,"buffer-alloc-unsafe":111,"buffer-fill":113}],113:[function(require,module,exports){ (function (Buffer){(function (){ /* Node.js 6.4.0 and up has full support */ var hasFullSupport = (function () { @@ -21399,7 +20707,7 @@ function fill (buffer, val, start, end, encoding) { module.exports = fill }).call(this)}).call(this,require("buffer").Buffer) -},{"buffer":116}],120:[function(require,module,exports){ +},{"buffer":110}],114:[function(require,module,exports){ (function (Buffer){(function (){ module.exports = function xor (a, b) { var length = Math.min(a.length, b.length) @@ -21413,7 +20721,7 @@ module.exports = function xor (a, b) { } }).call(this)}).call(this,require("buffer").Buffer) -},{"buffer":116}],121:[function(require,module,exports){ +},{"buffer":110}],115:[function(require,module,exports){ module.exports = { "100": "Continue", "101": "Switching Protocols", @@ -21479,7 +20787,7 @@ module.exports = { "511": "Network Authentication Required" } -},{}],122:[function(require,module,exports){ +},{}],116:[function(require,module,exports){ /*! * bytes * Copyright(c) 2012-2014 TJ Holowaychuk @@ -21643,7 +20951,7 @@ function parse(val) { return Math.floor(map[unit] * floatValue); } -},{}],123:[function(require,module,exports){ +},{}],117:[function(require,module,exports){ /*! cache-chunk-store. MIT License. Feross Aboukhadijeh */ const LRU = require('lru') const queueMicrotask = require('queue-microtask') @@ -21747,37 +21055,37 @@ class CacheStore { module.exports = CacheStore -},{"lru":258,"queue-microtask":355}],124:[function(require,module,exports){ +},{"lru":255,"queue-microtask":354}],118:[function(require,module,exports){ +arguments[4][29][0].apply(exports,arguments) +},{"dup":29}],119:[function(require,module,exports){ +arguments[4][30][0].apply(exports,arguments) +},{"./_stream_readable":121,"./_stream_writable":123,"_process":341,"dup":30,"inherits":246}],120:[function(require,module,exports){ +arguments[4][31][0].apply(exports,arguments) +},{"./_stream_transform":122,"dup":31,"inherits":246}],121:[function(require,module,exports){ arguments[4][32][0].apply(exports,arguments) -},{"dup":32}],125:[function(require,module,exports){ +},{"../errors":118,"./_stream_duplex":119,"./internal/streams/async_iterator":124,"./internal/streams/buffer_list":125,"./internal/streams/destroy":126,"./internal/streams/from":128,"./internal/streams/state":130,"./internal/streams/stream":131,"_process":341,"buffer":110,"dup":32,"events":193,"inherits":246,"string_decoder/":472,"util":67}],122:[function(require,module,exports){ arguments[4][33][0].apply(exports,arguments) -},{"./_stream_readable":127,"./_stream_writable":129,"_process":342,"dup":33,"inherits":249}],126:[function(require,module,exports){ +},{"../errors":118,"./_stream_duplex":119,"dup":33,"inherits":246}],123:[function(require,module,exports){ arguments[4][34][0].apply(exports,arguments) -},{"./_stream_transform":128,"dup":34,"inherits":249}],127:[function(require,module,exports){ +},{"../errors":118,"./_stream_duplex":119,"./internal/streams/destroy":126,"./internal/streams/state":130,"./internal/streams/stream":131,"_process":341,"buffer":110,"dup":34,"inherits":246,"util-deprecate":485}],124:[function(require,module,exports){ arguments[4][35][0].apply(exports,arguments) -},{"../errors":124,"./_stream_duplex":125,"./internal/streams/async_iterator":130,"./internal/streams/buffer_list":131,"./internal/streams/destroy":132,"./internal/streams/from":134,"./internal/streams/state":136,"./internal/streams/stream":137,"_process":342,"buffer":116,"dup":35,"events":196,"inherits":249,"string_decoder/":481,"util":73}],128:[function(require,module,exports){ +},{"./end-of-stream":127,"_process":341,"dup":35}],125:[function(require,module,exports){ arguments[4][36][0].apply(exports,arguments) -},{"../errors":124,"./_stream_duplex":125,"dup":36,"inherits":249}],129:[function(require,module,exports){ +},{"buffer":110,"dup":36,"util":67}],126:[function(require,module,exports){ arguments[4][37][0].apply(exports,arguments) -},{"../errors":124,"./_stream_duplex":125,"./internal/streams/destroy":132,"./internal/streams/state":136,"./internal/streams/stream":137,"_process":342,"buffer":116,"dup":37,"inherits":249,"util-deprecate":500}],130:[function(require,module,exports){ +},{"_process":341,"dup":37}],127:[function(require,module,exports){ arguments[4][38][0].apply(exports,arguments) -},{"./end-of-stream":133,"_process":342,"dup":38}],131:[function(require,module,exports){ +},{"../../../errors":118,"dup":38}],128:[function(require,module,exports){ arguments[4][39][0].apply(exports,arguments) -},{"buffer":116,"dup":39,"util":73}],132:[function(require,module,exports){ +},{"dup":39}],129:[function(require,module,exports){ arguments[4][40][0].apply(exports,arguments) -},{"_process":342,"dup":40}],133:[function(require,module,exports){ +},{"../../../errors":118,"./end-of-stream":127,"dup":40}],130:[function(require,module,exports){ arguments[4][41][0].apply(exports,arguments) -},{"../../../errors":124,"dup":41}],134:[function(require,module,exports){ +},{"../../../errors":118,"dup":41}],131:[function(require,module,exports){ arguments[4][42][0].apply(exports,arguments) -},{"dup":42}],135:[function(require,module,exports){ +},{"dup":42,"events":193}],132:[function(require,module,exports){ arguments[4][43][0].apply(exports,arguments) -},{"../../../errors":124,"./end-of-stream":133,"dup":43}],136:[function(require,module,exports){ -arguments[4][44][0].apply(exports,arguments) -},{"../../../errors":124,"dup":44}],137:[function(require,module,exports){ -arguments[4][45][0].apply(exports,arguments) -},{"dup":45,"events":196}],138:[function(require,module,exports){ -arguments[4][46][0].apply(exports,arguments) -},{"./lib/_stream_duplex.js":125,"./lib/_stream_passthrough.js":126,"./lib/_stream_readable.js":127,"./lib/_stream_transform.js":128,"./lib/_stream_writable.js":129,"./lib/internal/streams/end-of-stream.js":133,"./lib/internal/streams/pipeline.js":135,"dup":46}],139:[function(require,module,exports){ +},{"./lib/_stream_duplex.js":119,"./lib/_stream_passthrough.js":120,"./lib/_stream_readable.js":121,"./lib/_stream_transform.js":122,"./lib/_stream_writable.js":123,"./lib/internal/streams/end-of-stream.js":127,"./lib/internal/streams/pipeline.js":129,"dup":43}],133:[function(require,module,exports){ const BlockStream = require('block-stream2') const stream = require('readable-stream') @@ -21846,7 +21154,7 @@ class ChunkStoreWriteStream extends stream.Writable { module.exports = ChunkStoreWriteStream -},{"block-stream2":55,"readable-stream":138}],140:[function(require,module,exports){ +},{"block-stream2":49,"readable-stream":132}],134:[function(require,module,exports){ var Buffer = require('safe-buffer').Buffer var Transform = require('stream').Transform var StringDecoder = require('string_decoder').StringDecoder @@ -21947,7 +21255,7 @@ CipherBase.prototype._toString = function (value, enc, fin) { module.exports = CipherBase -},{"inherits":249,"safe-buffer":386,"stream":443,"string_decoder":481}],141:[function(require,module,exports){ +},{"inherits":246,"safe-buffer":383,"stream":434,"string_decoder":472}],135:[function(require,module,exports){ /*! * clipboard.js v2.0.8 * https://clipboardjs.com/ @@ -22902,7 +22210,268 @@ module.exports.TinyEmitter = E; /******/ })() .default; }); -},{}],142:[function(require,module,exports){ +},{}],136:[function(require,module,exports){ +(function (Buffer){(function (){ +var clone = (function() { +'use strict'; + +function _instanceof(obj, type) { + return type != null && obj instanceof type; +} + +var nativeMap; +try { + nativeMap = Map; +} catch(_) { + // maybe a reference error because no `Map`. Give it a dummy value that no + // value will ever be an instanceof. + nativeMap = function() {}; +} + +var nativeSet; +try { + nativeSet = Set; +} catch(_) { + nativeSet = function() {}; +} + +var nativePromise; +try { + nativePromise = Promise; +} catch(_) { + nativePromise = function() {}; +} + +/** + * Clones (copies) an Object using deep copying. + * + * This function supports circular references by default, but if you are certain + * there are no circular references in your object, you can save some CPU time + * by calling clone(obj, false). + * + * Caution: if `circular` is false and `parent` contains circular references, + * your program may enter an infinite loop and crash. + * + * @param `parent` - the object to be cloned + * @param `circular` - set to true if the object to be cloned may contain + * circular references. (optional - true by default) + * @param `depth` - set to a number if the object is only to be cloned to + * a particular depth. (optional - defaults to Infinity) + * @param `prototype` - sets the prototype to be used when cloning an object. + * (optional - defaults to parent prototype). + * @param `includeNonEnumerable` - set to true if the non-enumerable properties + * should be cloned as well. Non-enumerable properties on the prototype + * chain will be ignored. (optional - false by default) +*/ +function clone(parent, circular, depth, prototype, includeNonEnumerable) { + if (typeof circular === 'object') { + depth = circular.depth; + prototype = circular.prototype; + includeNonEnumerable = circular.includeNonEnumerable; + circular = circular.circular; + } + // maintain two arrays for circular references, where corresponding parents + // and children have the same index + var allParents = []; + var allChildren = []; + + var useBuffer = typeof Buffer != 'undefined'; + + if (typeof circular == 'undefined') + circular = true; + + if (typeof depth == 'undefined') + depth = Infinity; + + // recurse this function so we don't reset allParents and allChildren + function _clone(parent, depth) { + // cloning null always returns null + if (parent === null) + return null; + + if (depth === 0) + return parent; + + var child; + var proto; + if (typeof parent != 'object') { + return parent; + } + + if (_instanceof(parent, nativeMap)) { + child = new nativeMap(); + } else if (_instanceof(parent, nativeSet)) { + child = new nativeSet(); + } else if (_instanceof(parent, nativePromise)) { + child = new nativePromise(function (resolve, reject) { + parent.then(function(value) { + resolve(_clone(value, depth - 1)); + }, function(err) { + reject(_clone(err, depth - 1)); + }); + }); + } else if (clone.__isArray(parent)) { + child = []; + } else if (clone.__isRegExp(parent)) { + child = new RegExp(parent.source, __getRegExpFlags(parent)); + if (parent.lastIndex) child.lastIndex = parent.lastIndex; + } else if (clone.__isDate(parent)) { + child = new Date(parent.getTime()); + } else if (useBuffer && Buffer.isBuffer(parent)) { + if (Buffer.allocUnsafe) { + // Node.js >= 4.5.0 + child = Buffer.allocUnsafe(parent.length); + } else { + // Older Node.js versions + child = new Buffer(parent.length); + } + parent.copy(child); + return child; + } else if (_instanceof(parent, Error)) { + child = Object.create(parent); + } else { + if (typeof prototype == 'undefined') { + proto = Object.getPrototypeOf(parent); + child = Object.create(proto); + } + else { + child = Object.create(prototype); + proto = prototype; + } + } + + if (circular) { + var index = allParents.indexOf(parent); + + if (index != -1) { + return allChildren[index]; + } + allParents.push(parent); + allChildren.push(child); + } + + if (_instanceof(parent, nativeMap)) { + parent.forEach(function(value, key) { + var keyChild = _clone(key, depth - 1); + var valueChild = _clone(value, depth - 1); + child.set(keyChild, valueChild); + }); + } + if (_instanceof(parent, nativeSet)) { + parent.forEach(function(value) { + var entryChild = _clone(value, depth - 1); + child.add(entryChild); + }); + } + + for (var i in parent) { + var attrs; + if (proto) { + attrs = Object.getOwnPropertyDescriptor(proto, i); + } + + if (attrs && attrs.set == null) { + continue; + } + child[i] = _clone(parent[i], depth - 1); + } + + if (Object.getOwnPropertySymbols) { + var symbols = Object.getOwnPropertySymbols(parent); + for (var i = 0; i < symbols.length; i++) { + // Don't need to worry about cloning a symbol because it is a primitive, + // like a number or string. + var symbol = symbols[i]; + var descriptor = Object.getOwnPropertyDescriptor(parent, symbol); + if (descriptor && !descriptor.enumerable && !includeNonEnumerable) { + continue; + } + child[symbol] = _clone(parent[symbol], depth - 1); + if (!descriptor.enumerable) { + Object.defineProperty(child, symbol, { + enumerable: false + }); + } + } + } + + if (includeNonEnumerable) { + var allPropertyNames = Object.getOwnPropertyNames(parent); + for (var i = 0; i < allPropertyNames.length; i++) { + var propertyName = allPropertyNames[i]; + var descriptor = Object.getOwnPropertyDescriptor(parent, propertyName); + if (descriptor && descriptor.enumerable) { + continue; + } + child[propertyName] = _clone(parent[propertyName], depth - 1); + Object.defineProperty(child, propertyName, { + enumerable: false + }); + } + } + + return child; + } + + return _clone(parent, depth); +} + +/** + * Simple flat clone using prototype, accepts only objects, usefull for property + * override on FLAT configuration object (no nested props). + * + * USE WITH CAUTION! This may not behave as you wish if you do not know how this + * works. + */ +clone.clonePrototype = function clonePrototype(parent) { + if (parent === null) + return null; + + var c = function () {}; + c.prototype = parent; + return new c(); +}; + +// private utility functions + +function __objToStr(o) { + return Object.prototype.toString.call(o); +} +clone.__objToStr = __objToStr; + +function __isDate(o) { + return typeof o === 'object' && __objToStr(o) === '[object Date]'; +} +clone.__isDate = __isDate; + +function __isArray(o) { + return typeof o === 'object' && __objToStr(o) === '[object Array]'; +} +clone.__isArray = __isArray; + +function __isRegExp(o) { + return typeof o === 'object' && __objToStr(o) === '[object RegExp]'; +} +clone.__isRegExp = __isRegExp; + +function __getRegExpFlags(re) { + var flags = ''; + if (re.global) flags += 'g'; + if (re.ignoreCase) flags += 'i'; + if (re.multiline) flags += 'm'; + return flags; +} +clone.__getRegExpFlags = __getRegExpFlags; + +return clone; +})(); + +if (typeof module === 'object' && module.exports) { + module.exports = clone; +} + +}).call(this)}).call(this,require("buffer").Buffer) +},{"buffer":110}],137:[function(require,module,exports){ module.exports = function cpus () { var num = navigator.hardwareConcurrency || 1 var cpus = [] @@ -22916,7 +22485,7 @@ module.exports = function cpus () { return cpus } -},{}],143:[function(require,module,exports){ +},{}],138:[function(require,module,exports){ (function (Buffer){(function (){ var elliptic = require('elliptic') var BN = require('bn.js') @@ -23044,9 +22613,9 @@ function formatReturnValue (bn, enc, len) { } }).call(this)}).call(this,require("buffer").Buffer) -},{"bn.js":144,"buffer":116,"elliptic":177}],144:[function(require,module,exports){ +},{"bn.js":139,"buffer":110,"elliptic":174}],139:[function(require,module,exports){ arguments[4][18][0].apply(exports,arguments) -},{"buffer":73,"dup":18}],145:[function(require,module,exports){ +},{"buffer":67,"dup":18}],140:[function(require,module,exports){ 'use strict' var inherits = require('inherits') var MD5 = require('md5.js') @@ -23078,14 +22647,14 @@ module.exports = function createHash (alg) { return new Hash(sha(alg)) } -},{"cipher-base":140,"inherits":249,"md5.js":264,"ripemd160":382,"sha.js":389}],146:[function(require,module,exports){ +},{"cipher-base":134,"inherits":246,"md5.js":258,"ripemd160":379,"sha.js":386}],141:[function(require,module,exports){ var MD5 = require('md5.js') module.exports = function (buffer) { return new MD5().update(buffer).digest() } -},{"md5.js":264}],147:[function(require,module,exports){ +},{"md5.js":258}],142:[function(require,module,exports){ 'use strict' var inherits = require('inherits') var Legacy = require('./legacy') @@ -23149,7 +22718,7 @@ module.exports = function createHmac (alg, key) { return new Hmac(alg, key) } -},{"./legacy":148,"cipher-base":140,"create-hash/md5":146,"inherits":249,"ripemd160":382,"safe-buffer":386,"sha.js":389}],148:[function(require,module,exports){ +},{"./legacy":143,"cipher-base":134,"create-hash/md5":141,"inherits":246,"ripemd160":379,"safe-buffer":383,"sha.js":386}],143:[function(require,module,exports){ 'use strict' var inherits = require('inherits') var Buffer = require('safe-buffer').Buffer @@ -23197,7 +22766,7 @@ Hmac.prototype._final = function () { } module.exports = Hmac -},{"cipher-base":140,"inherits":249,"safe-buffer":386}],149:[function(require,module,exports){ +},{"cipher-base":134,"inherits":246,"safe-buffer":383}],144:[function(require,module,exports){ (function (Buffer){(function (){ /*! create-torrent. MIT License. WebTorrent LLC */ const bencode = require('bencode') @@ -23656,37 +23225,37 @@ module.exports.announceList = announceList module.exports.isJunkPath = isJunkPath }).call(this)}).call(this,require("buffer").Buffer) -},{"./get-files":73,"bencode":23,"block-stream2":55,"buffer":116,"filestream/read":215,"is-file":73,"junk":253,"multistream":310,"once":327,"path":334,"piece-length":341,"queue-microtask":355,"readable-stream":164,"run-parallel":384,"simple-sha1":417}],150:[function(require,module,exports){ +},{"./get-files":67,"bencode":23,"block-stream2":49,"buffer":110,"filestream/read":212,"is-file":67,"junk":250,"multistream":309,"once":326,"path":333,"piece-length":340,"queue-microtask":354,"readable-stream":159,"run-parallel":381,"simple-sha1":411}],145:[function(require,module,exports){ +arguments[4][29][0].apply(exports,arguments) +},{"dup":29}],146:[function(require,module,exports){ +arguments[4][30][0].apply(exports,arguments) +},{"./_stream_readable":148,"./_stream_writable":150,"_process":341,"dup":30,"inherits":246}],147:[function(require,module,exports){ +arguments[4][31][0].apply(exports,arguments) +},{"./_stream_transform":149,"dup":31,"inherits":246}],148:[function(require,module,exports){ arguments[4][32][0].apply(exports,arguments) -},{"dup":32}],151:[function(require,module,exports){ +},{"../errors":145,"./_stream_duplex":146,"./internal/streams/async_iterator":151,"./internal/streams/buffer_list":152,"./internal/streams/destroy":153,"./internal/streams/from":155,"./internal/streams/state":157,"./internal/streams/stream":158,"_process":341,"buffer":110,"dup":32,"events":193,"inherits":246,"string_decoder/":472,"util":67}],149:[function(require,module,exports){ arguments[4][33][0].apply(exports,arguments) -},{"./_stream_readable":153,"./_stream_writable":155,"_process":342,"dup":33,"inherits":249}],152:[function(require,module,exports){ +},{"../errors":145,"./_stream_duplex":146,"dup":33,"inherits":246}],150:[function(require,module,exports){ arguments[4][34][0].apply(exports,arguments) -},{"./_stream_transform":154,"dup":34,"inherits":249}],153:[function(require,module,exports){ +},{"../errors":145,"./_stream_duplex":146,"./internal/streams/destroy":153,"./internal/streams/state":157,"./internal/streams/stream":158,"_process":341,"buffer":110,"dup":34,"inherits":246,"util-deprecate":485}],151:[function(require,module,exports){ arguments[4][35][0].apply(exports,arguments) -},{"../errors":150,"./_stream_duplex":151,"./internal/streams/async_iterator":156,"./internal/streams/buffer_list":157,"./internal/streams/destroy":158,"./internal/streams/from":160,"./internal/streams/state":162,"./internal/streams/stream":163,"_process":342,"buffer":116,"dup":35,"events":196,"inherits":249,"string_decoder/":481,"util":73}],154:[function(require,module,exports){ +},{"./end-of-stream":154,"_process":341,"dup":35}],152:[function(require,module,exports){ arguments[4][36][0].apply(exports,arguments) -},{"../errors":150,"./_stream_duplex":151,"dup":36,"inherits":249}],155:[function(require,module,exports){ +},{"buffer":110,"dup":36,"util":67}],153:[function(require,module,exports){ arguments[4][37][0].apply(exports,arguments) -},{"../errors":150,"./_stream_duplex":151,"./internal/streams/destroy":158,"./internal/streams/state":162,"./internal/streams/stream":163,"_process":342,"buffer":116,"dup":37,"inherits":249,"util-deprecate":500}],156:[function(require,module,exports){ +},{"_process":341,"dup":37}],154:[function(require,module,exports){ arguments[4][38][0].apply(exports,arguments) -},{"./end-of-stream":159,"_process":342,"dup":38}],157:[function(require,module,exports){ +},{"../../../errors":145,"dup":38}],155:[function(require,module,exports){ arguments[4][39][0].apply(exports,arguments) -},{"buffer":116,"dup":39,"util":73}],158:[function(require,module,exports){ +},{"dup":39}],156:[function(require,module,exports){ arguments[4][40][0].apply(exports,arguments) -},{"_process":342,"dup":40}],159:[function(require,module,exports){ +},{"../../../errors":145,"./end-of-stream":154,"dup":40}],157:[function(require,module,exports){ arguments[4][41][0].apply(exports,arguments) -},{"../../../errors":150,"dup":41}],160:[function(require,module,exports){ +},{"../../../errors":145,"dup":41}],158:[function(require,module,exports){ arguments[4][42][0].apply(exports,arguments) -},{"dup":42}],161:[function(require,module,exports){ +},{"dup":42,"events":193}],159:[function(require,module,exports){ arguments[4][43][0].apply(exports,arguments) -},{"../../../errors":150,"./end-of-stream":159,"dup":43}],162:[function(require,module,exports){ -arguments[4][44][0].apply(exports,arguments) -},{"../../../errors":150,"dup":44}],163:[function(require,module,exports){ -arguments[4][45][0].apply(exports,arguments) -},{"dup":45,"events":196}],164:[function(require,module,exports){ -arguments[4][46][0].apply(exports,arguments) -},{"./lib/_stream_duplex.js":151,"./lib/_stream_passthrough.js":152,"./lib/_stream_readable.js":153,"./lib/_stream_transform.js":154,"./lib/_stream_writable.js":155,"./lib/internal/streams/end-of-stream.js":159,"./lib/internal/streams/pipeline.js":161,"dup":46}],165:[function(require,module,exports){ +},{"./lib/_stream_duplex.js":146,"./lib/_stream_passthrough.js":147,"./lib/_stream_readable.js":148,"./lib/_stream_transform.js":149,"./lib/_stream_writable.js":150,"./lib/internal/streams/end-of-stream.js":154,"./lib/internal/streams/pipeline.js":156,"dup":43}],160:[function(require,module,exports){ 'use strict' exports.randomBytes = exports.rng = exports.pseudoRandomBytes = exports.prng = require('randombytes') @@ -23785,7 +23354,556 @@ exports.constants = { 'POINT_CONVERSION_HYBRID': 6 } -},{"browserify-cipher":91,"browserify-sign":98,"browserify-sign/algos":95,"create-ecdh":143,"create-hash":145,"create-hmac":147,"diffie-hellman":172,"pbkdf2":335,"public-encrypt":343,"randombytes":358,"randomfill":359}],166:[function(require,module,exports){ +},{"browserify-cipher":85,"browserify-sign":92,"browserify-sign/algos":89,"create-ecdh":138,"create-hash":140,"create-hmac":142,"diffie-hellman":169,"pbkdf2":334,"public-encrypt":342,"randombytes":357,"randomfill":358}],161:[function(require,module,exports){ +(function (process){(function (){ +/* eslint-env browser */ + +/** + * This is the web browser implementation of `debug()`. + */ + +exports.formatArgs = formatArgs; +exports.save = save; +exports.load = load; +exports.useColors = useColors; +exports.storage = localstorage(); +exports.destroy = (() => { + let warned = false; + + return () => { + if (!warned) { + warned = true; + console.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.'); + } + }; +})(); + +/** + * Colors. + */ + +exports.colors = [ + '#0000CC', + '#0000FF', + '#0033CC', + '#0033FF', + '#0066CC', + '#0066FF', + '#0099CC', + '#0099FF', + '#00CC00', + '#00CC33', + '#00CC66', + '#00CC99', + '#00CCCC', + '#00CCFF', + '#3300CC', + '#3300FF', + '#3333CC', + '#3333FF', + '#3366CC', + '#3366FF', + '#3399CC', + '#3399FF', + '#33CC00', + '#33CC33', + '#33CC66', + '#33CC99', + '#33CCCC', + '#33CCFF', + '#6600CC', + '#6600FF', + '#6633CC', + '#6633FF', + '#66CC00', + '#66CC33', + '#9900CC', + '#9900FF', + '#9933CC', + '#9933FF', + '#99CC00', + '#99CC33', + '#CC0000', + '#CC0033', + '#CC0066', + '#CC0099', + '#CC00CC', + '#CC00FF', + '#CC3300', + '#CC3333', + '#CC3366', + '#CC3399', + '#CC33CC', + '#CC33FF', + '#CC6600', + '#CC6633', + '#CC9900', + '#CC9933', + '#CCCC00', + '#CCCC33', + '#FF0000', + '#FF0033', + '#FF0066', + '#FF0099', + '#FF00CC', + '#FF00FF', + '#FF3300', + '#FF3333', + '#FF3366', + '#FF3399', + '#FF33CC', + '#FF33FF', + '#FF6600', + '#FF6633', + '#FF9900', + '#FF9933', + '#FFCC00', + '#FFCC33' +]; + +/** + * Currently only WebKit-based Web Inspectors, Firefox >= v31, + * and the Firebug extension (any Firefox version) are known + * to support "%c" CSS customizations. + * + * TODO: add a `localStorage` variable to explicitly enable/disable colors + */ + +// eslint-disable-next-line complexity +function useColors() { + // NB: In an Electron preload script, document will be defined but not fully + // initialized. Since we know we're in Chrome, we'll just detect this case + // explicitly + if (typeof window !== 'undefined' && window.process && (window.process.type === 'renderer' || window.process.__nwjs)) { + return true; + } + + // Internet Explorer and Edge do not support colors. + if (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) { + return false; + } + + // Is webkit? http://stackoverflow.com/a/16459606/376773 + // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632 + return (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) || + // Is firebug? http://stackoverflow.com/a/398120/376773 + (typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) || + // Is firefox >= v31? + // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages + (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31) || + // Double check webkit in userAgent just in case we are in a worker + (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)); +} + +/** + * Colorize log arguments if enabled. + * + * @api public + */ + +function formatArgs(args) { + args[0] = (this.useColors ? '%c' : '') + + this.namespace + + (this.useColors ? ' %c' : ' ') + + args[0] + + (this.useColors ? '%c ' : ' ') + + '+' + module.exports.humanize(this.diff); + + if (!this.useColors) { + return; + } + + const c = 'color: ' + this.color; + args.splice(1, 0, c, 'color: inherit'); + + // The final "%c" is somewhat tricky, because there could be other + // arguments passed either before or after the %c, so we need to + // figure out the correct index to insert the CSS into + let index = 0; + let lastC = 0; + args[0].replace(/%[a-zA-Z%]/g, match => { + if (match === '%%') { + return; + } + index++; + if (match === '%c') { + // We only are interested in the *last* %c + // (the user may have provided their own) + lastC = index; + } + }); + + args.splice(lastC, 0, c); +} + +/** + * Invokes `console.debug()` when available. + * No-op when `console.debug` is not a "function". + * If `console.debug` is not available, falls back + * to `console.log`. + * + * @api public + */ +exports.log = console.debug || console.log || (() => {}); + +/** + * Save `namespaces`. + * + * @param {String} namespaces + * @api private + */ +function save(namespaces) { + try { + if (namespaces) { + exports.storage.setItem('debug', namespaces); + } else { + exports.storage.removeItem('debug'); + } + } catch (error) { + // Swallow + // XXX (@Qix-) should we be logging these? + } +} + +/** + * Load `namespaces`. + * + * @return {String} returns the previously persisted debug modes + * @api private + */ +function load() { + let r; + try { + r = exports.storage.getItem('debug'); + } catch (error) { + // Swallow + // XXX (@Qix-) should we be logging these? + } + + // If debug isn't set in LS, and we're in Electron, try to load $DEBUG + if (!r && typeof process !== 'undefined' && 'env' in process) { + r = process.env.DEBUG; + } + + return r; +} + +/** + * Localstorage attempts to return the localstorage. + * + * This is necessary because safari throws + * when a user disables cookies/localstorage + * and you attempt to access it. + * + * @return {LocalStorage} + * @api private + */ + +function localstorage() { + try { + // TVMLKit (Apple TV JS Runtime) does not have a window object, just localStorage in the global context + // The Browser also has localStorage in the global context. + return localStorage; + } catch (error) { + // Swallow + // XXX (@Qix-) should we be logging these? + } +} + +module.exports = require('./common')(exports); + +const {formatters} = module.exports; + +/** + * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default. + */ + +formatters.j = function (v) { + try { + return JSON.stringify(v); + } catch (error) { + return '[UnexpectedJSONParseError]: ' + error.message; + } +}; + +}).call(this)}).call(this,require('_process')) +},{"./common":162,"_process":341}],162:[function(require,module,exports){ + +/** + * This is the common logic for both the Node.js and web browser + * implementations of `debug()`. + */ + +function setup(env) { + createDebug.debug = createDebug; + createDebug.default = createDebug; + createDebug.coerce = coerce; + createDebug.disable = disable; + createDebug.enable = enable; + createDebug.enabled = enabled; + createDebug.humanize = require('ms'); + createDebug.destroy = destroy; + + Object.keys(env).forEach(key => { + createDebug[key] = env[key]; + }); + + /** + * The currently active debug mode names, and names to skip. + */ + + createDebug.names = []; + createDebug.skips = []; + + /** + * Map of special "%n" handling functions, for the debug "format" argument. + * + * Valid key names are a single, lower or upper-case letter, i.e. "n" and "N". + */ + createDebug.formatters = {}; + + /** + * Selects a color for a debug namespace + * @param {String} namespace The namespace string for the for the debug instance to be colored + * @return {Number|String} An ANSI color code for the given namespace + * @api private + */ + function selectColor(namespace) { + let hash = 0; + + for (let i = 0; i < namespace.length; i++) { + hash = ((hash << 5) - hash) + namespace.charCodeAt(i); + hash |= 0; // Convert to 32bit integer + } + + return createDebug.colors[Math.abs(hash) % createDebug.colors.length]; + } + createDebug.selectColor = selectColor; + + /** + * Create a debugger with the given `namespace`. + * + * @param {String} namespace + * @return {Function} + * @api public + */ + function createDebug(namespace) { + let prevTime; + let enableOverride = null; + let namespacesCache; + let enabledCache; + + function debug(...args) { + // Disabled? + if (!debug.enabled) { + return; + } + + const self = debug; + + // Set `diff` timestamp + const curr = Number(new Date()); + const ms = curr - (prevTime || curr); + self.diff = ms; + self.prev = prevTime; + self.curr = curr; + prevTime = curr; + + args[0] = createDebug.coerce(args[0]); + + if (typeof args[0] !== 'string') { + // Anything else let's inspect with %O + args.unshift('%O'); + } + + // Apply any `formatters` transformations + let index = 0; + args[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => { + // If we encounter an escaped % then don't increase the array index + if (match === '%%') { + return '%'; + } + index++; + const formatter = createDebug.formatters[format]; + if (typeof formatter === 'function') { + const val = args[index]; + match = formatter.call(self, val); + + // Now we need to remove `args[index]` since it's inlined in the `format` + args.splice(index, 1); + index--; + } + return match; + }); + + // Apply env-specific formatting (colors, etc.) + createDebug.formatArgs.call(self, args); + + const logFn = self.log || createDebug.log; + logFn.apply(self, args); + } + + debug.namespace = namespace; + debug.useColors = createDebug.useColors(); + debug.color = createDebug.selectColor(namespace); + debug.extend = extend; + debug.destroy = createDebug.destroy; // XXX Temporary. Will be removed in the next major release. + + Object.defineProperty(debug, 'enabled', { + enumerable: true, + configurable: false, + get: () => { + if (enableOverride !== null) { + return enableOverride; + } + if (namespacesCache !== createDebug.namespaces) { + namespacesCache = createDebug.namespaces; + enabledCache = createDebug.enabled(namespace); + } + + return enabledCache; + }, + set: v => { + enableOverride = v; + } + }); + + // Env-specific initialization logic for debug instances + if (typeof createDebug.init === 'function') { + createDebug.init(debug); + } + + return debug; + } + + function extend(namespace, delimiter) { + const newDebug = createDebug(this.namespace + (typeof delimiter === 'undefined' ? ':' : delimiter) + namespace); + newDebug.log = this.log; + return newDebug; + } + + /** + * Enables a debug mode by namespaces. This can include modes + * separated by a colon and wildcards. + * + * @param {String} namespaces + * @api public + */ + function enable(namespaces) { + createDebug.save(namespaces); + createDebug.namespaces = namespaces; + + createDebug.names = []; + createDebug.skips = []; + + let i; + const split = (typeof namespaces === 'string' ? namespaces : '').split(/[\s,]+/); + const len = split.length; + + for (i = 0; i < len; i++) { + if (!split[i]) { + // ignore empty strings + continue; + } + + namespaces = split[i].replace(/\*/g, '.*?'); + + if (namespaces[0] === '-') { + createDebug.skips.push(new RegExp('^' + namespaces.substr(1) + '$')); + } else { + createDebug.names.push(new RegExp('^' + namespaces + '$')); + } + } + } + + /** + * Disable debug output. + * + * @return {String} namespaces + * @api public + */ + function disable() { + const namespaces = [ + ...createDebug.names.map(toNamespace), + ...createDebug.skips.map(toNamespace).map(namespace => '-' + namespace) + ].join(','); + createDebug.enable(''); + return namespaces; + } + + /** + * Returns true if the given mode name is enabled, false otherwise. + * + * @param {String} name + * @return {Boolean} + * @api public + */ + function enabled(name) { + if (name[name.length - 1] === '*') { + return true; + } + + let i; + let len; + + for (i = 0, len = createDebug.skips.length; i < len; i++) { + if (createDebug.skips[i].test(name)) { + return false; + } + } + + for (i = 0, len = createDebug.names.length; i < len; i++) { + if (createDebug.names[i].test(name)) { + return true; + } + } + + return false; + } + + /** + * Convert regexp to namespace + * + * @param {RegExp} regxep + * @return {String} namespace + * @api private + */ + function toNamespace(regexp) { + return regexp.toString() + .substring(2, regexp.toString().length - 2) + .replace(/\.\*\?$/, '*'); + } + + /** + * Coerce `val`. + * + * @param {Mixed} val + * @return {Mixed} + * @api private + */ + function coerce(val) { + if (val instanceof Error) { + return val.stack || val.message; + } + return val; + } + + /** + * XXX DO NOT USE. This is a temporary stub function. + * XXX It WILL be removed in the next major release. + */ + function destroy() { + console.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.'); + } + + createDebug.enable(createDebug.load()); + + return createDebug; +} + +module.exports = setup; + +},{"ms":308}],163:[function(require,module,exports){ 'use strict'; exports.utils = require('./des/utils'); @@ -23794,7 +23912,7 @@ exports.DES = require('./des/des'); exports.CBC = require('./des/cbc'); exports.EDE = require('./des/ede'); -},{"./des/cbc":167,"./des/cipher":168,"./des/des":169,"./des/ede":170,"./des/utils":171}],167:[function(require,module,exports){ +},{"./des/cbc":164,"./des/cipher":165,"./des/des":166,"./des/ede":167,"./des/utils":168}],164:[function(require,module,exports){ 'use strict'; var assert = require('minimalistic-assert'); @@ -23861,7 +23979,7 @@ proto._update = function _update(inp, inOff, out, outOff) { } }; -},{"inherits":249,"minimalistic-assert":287}],168:[function(require,module,exports){ +},{"inherits":246,"minimalistic-assert":285}],165:[function(require,module,exports){ 'use strict'; var assert = require('minimalistic-assert'); @@ -24004,7 +24122,7 @@ Cipher.prototype._finalDecrypt = function _finalDecrypt() { return this._unpad(out); }; -},{"minimalistic-assert":287}],169:[function(require,module,exports){ +},{"minimalistic-assert":285}],166:[function(require,module,exports){ 'use strict'; var assert = require('minimalistic-assert'); @@ -24148,7 +24266,7 @@ DES.prototype._decrypt = function _decrypt(state, lStart, rStart, out, off) { utils.rip(l, r, out, off); }; -},{"./cipher":168,"./utils":171,"inherits":249,"minimalistic-assert":287}],170:[function(require,module,exports){ +},{"./cipher":165,"./utils":168,"inherits":246,"minimalistic-assert":285}],167:[function(require,module,exports){ 'use strict'; var assert = require('minimalistic-assert'); @@ -24204,7 +24322,7 @@ EDE.prototype._update = function _update(inp, inOff, out, outOff) { EDE.prototype._pad = DES.prototype._pad; EDE.prototype._unpad = DES.prototype._unpad; -},{"./cipher":168,"./des":169,"inherits":249,"minimalistic-assert":287}],171:[function(require,module,exports){ +},{"./cipher":165,"./des":166,"inherits":246,"minimalistic-assert":285}],168:[function(require,module,exports){ 'use strict'; exports.readUInt32BE = function readUInt32BE(bytes, off) { @@ -24462,7 +24580,7 @@ exports.padSplit = function padSplit(num, size, group) { return out.join(' '); }; -},{}],172:[function(require,module,exports){ +},{}],169:[function(require,module,exports){ (function (Buffer){(function (){ var generatePrime = require('./lib/generatePrime') var primes = require('./lib/primes.json') @@ -24508,7 +24626,7 @@ exports.DiffieHellmanGroup = exports.createDiffieHellmanGroup = exports.getDiffi exports.createDiffieHellman = exports.DiffieHellman = createDiffieHellman }).call(this)}).call(this,require("buffer").Buffer) -},{"./lib/dh":173,"./lib/generatePrime":174,"./lib/primes.json":175,"buffer":116}],173:[function(require,module,exports){ +},{"./lib/dh":170,"./lib/generatePrime":171,"./lib/primes.json":172,"buffer":110}],170:[function(require,module,exports){ (function (Buffer){(function (){ var BN = require('bn.js'); var MillerRabin = require('miller-rabin'); @@ -24676,7 +24794,7 @@ function formatReturnValue(bn, enc) { } }).call(this)}).call(this,require("buffer").Buffer) -},{"./generatePrime":174,"bn.js":176,"buffer":116,"miller-rabin":282,"randombytes":358}],174:[function(require,module,exports){ +},{"./generatePrime":171,"bn.js":173,"buffer":110,"miller-rabin":276,"randombytes":357}],171:[function(require,module,exports){ var randomBytes = require('randombytes'); module.exports = findPrime; findPrime.simpleSieve = simpleSieve; @@ -24783,7 +24901,7 @@ function findPrime(bits, gen) { } -},{"bn.js":176,"miller-rabin":282,"randombytes":358}],175:[function(require,module,exports){ +},{"bn.js":173,"miller-rabin":276,"randombytes":357}],172:[function(require,module,exports){ module.exports={ "modp1": { "gen": "02", @@ -24818,9 +24936,9 @@ module.exports={ "prime": "ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dbe115974a3926f12fee5e438777cb6a932df8cd8bec4d073b931ba3bc832b68d9dd300741fa7bf8afc47ed2576f6936ba424663aab639c5ae4f5683423b4742bf1c978238f16cbe39d652de3fdb8befc848ad922222e04a4037c0713eb57a81a23f0c73473fc646cea306b4bcbc8862f8385ddfa9d4b7fa2c087e879683303ed5bdd3a062b3cf5b3a278a66d2a13f83f44f82ddf310ee074ab6a364597e899a0255dc164f31cc50846851df9ab48195ded7ea1b1d510bd7ee74d73faf36bc31ecfa268359046f4eb879f924009438b481c6cd7889a002ed5ee382bc9190da6fc026e479558e4475677e9aa9e3050e2765694dfc81f56e880b96e7160c980dd98edd3dfffffffffffffffff" } } -},{}],176:[function(require,module,exports){ +},{}],173:[function(require,module,exports){ arguments[4][18][0].apply(exports,arguments) -},{"buffer":73,"dup":18}],177:[function(require,module,exports){ +},{"buffer":67,"dup":18}],174:[function(require,module,exports){ 'use strict'; var elliptic = exports; @@ -24835,7 +24953,7 @@ elliptic.curves = require('./elliptic/curves'); elliptic.ec = require('./elliptic/ec'); elliptic.eddsa = require('./elliptic/eddsa'); -},{"../package.json":193,"./elliptic/curve":180,"./elliptic/curves":183,"./elliptic/ec":184,"./elliptic/eddsa":187,"./elliptic/utils":191,"brorand":72}],178:[function(require,module,exports){ +},{"../package.json":190,"./elliptic/curve":177,"./elliptic/curves":180,"./elliptic/ec":181,"./elliptic/eddsa":184,"./elliptic/utils":188,"brorand":66}],175:[function(require,module,exports){ 'use strict'; var BN = require('bn.js'); @@ -25218,7 +25336,7 @@ BasePoint.prototype.dblp = function dblp(k) { return r; }; -},{"../utils":191,"bn.js":192}],179:[function(require,module,exports){ +},{"../utils":188,"bn.js":189}],176:[function(require,module,exports){ 'use strict'; var utils = require('../utils'); @@ -25655,7 +25773,7 @@ Point.prototype.eqXToP = function eqXToP(x) { Point.prototype.toP = Point.prototype.normalize; Point.prototype.mixedAdd = Point.prototype.add; -},{"../utils":191,"./base":178,"bn.js":192,"inherits":249}],180:[function(require,module,exports){ +},{"../utils":188,"./base":175,"bn.js":189,"inherits":246}],177:[function(require,module,exports){ 'use strict'; var curve = exports; @@ -25665,7 +25783,7 @@ curve.short = require('./short'); curve.mont = require('./mont'); curve.edwards = require('./edwards'); -},{"./base":178,"./edwards":179,"./mont":181,"./short":182}],181:[function(require,module,exports){ +},{"./base":175,"./edwards":176,"./mont":178,"./short":179}],178:[function(require,module,exports){ 'use strict'; var BN = require('bn.js'); @@ -25845,7 +25963,7 @@ Point.prototype.getX = function getX() { return this.x.fromRed(); }; -},{"../utils":191,"./base":178,"bn.js":192,"inherits":249}],182:[function(require,module,exports){ +},{"../utils":188,"./base":175,"bn.js":189,"inherits":246}],179:[function(require,module,exports){ 'use strict'; var utils = require('../utils'); @@ -26785,7 +26903,7 @@ JPoint.prototype.isInfinity = function isInfinity() { return this.z.cmpn(0) === 0; }; -},{"../utils":191,"./base":178,"bn.js":192,"inherits":249}],183:[function(require,module,exports){ +},{"../utils":188,"./base":175,"bn.js":189,"inherits":246}],180:[function(require,module,exports){ 'use strict'; var curves = exports; @@ -26993,7 +27111,7 @@ defineCurve('secp256k1', { ], }); -},{"./curve":180,"./precomputed/secp256k1":190,"./utils":191,"hash.js":233}],184:[function(require,module,exports){ +},{"./curve":177,"./precomputed/secp256k1":187,"./utils":188,"hash.js":230}],181:[function(require,module,exports){ 'use strict'; var BN = require('bn.js'); @@ -27238,7 +27356,7 @@ EC.prototype.getKeyRecoveryParam = function(e, signature, Q, enc) { throw new Error('Unable to find valid recovery factor'); }; -},{"../curves":183,"../utils":191,"./key":185,"./signature":186,"bn.js":192,"brorand":72,"hmac-drbg":245}],185:[function(require,module,exports){ +},{"../curves":180,"../utils":188,"./key":182,"./signature":183,"bn.js":189,"brorand":66,"hmac-drbg":242}],182:[function(require,module,exports){ 'use strict'; var BN = require('bn.js'); @@ -27361,7 +27479,7 @@ KeyPair.prototype.inspect = function inspect() { ' pub: ' + (this.pub && this.pub.inspect()) + ' >'; }; -},{"../utils":191,"bn.js":192}],186:[function(require,module,exports){ +},{"../utils":188,"bn.js":189}],183:[function(require,module,exports){ 'use strict'; var BN = require('bn.js'); @@ -27529,7 +27647,7 @@ Signature.prototype.toDER = function toDER(enc) { return utils.encode(res, enc); }; -},{"../utils":191,"bn.js":192}],187:[function(require,module,exports){ +},{"../utils":188,"bn.js":189}],184:[function(require,module,exports){ 'use strict'; var hash = require('hash.js'); @@ -27649,7 +27767,7 @@ EDDSA.prototype.isPoint = function isPoint(val) { return val instanceof this.pointClass; }; -},{"../curves":183,"../utils":191,"./key":188,"./signature":189,"hash.js":233}],188:[function(require,module,exports){ +},{"../curves":180,"../utils":188,"./key":185,"./signature":186,"hash.js":230}],185:[function(require,module,exports){ 'use strict'; var utils = require('../utils'); @@ -27746,7 +27864,7 @@ KeyPair.prototype.getPublic = function getPublic(enc) { module.exports = KeyPair; -},{"../utils":191}],189:[function(require,module,exports){ +},{"../utils":188}],186:[function(require,module,exports){ 'use strict'; var BN = require('bn.js'); @@ -27813,7 +27931,7 @@ Signature.prototype.toHex = function toHex() { module.exports = Signature; -},{"../utils":191,"bn.js":192}],190:[function(require,module,exports){ +},{"../utils":188,"bn.js":189}],187:[function(require,module,exports){ module.exports = { doubles: { step: 4, @@ -28595,7 +28713,7 @@ module.exports = { }, }; -},{}],191:[function(require,module,exports){ +},{}],188:[function(require,module,exports){ 'use strict'; var utils = exports; @@ -28716,40 +28834,53 @@ function intFromLE(bytes) { utils.intFromLE = intFromLE; -},{"bn.js":192,"minimalistic-assert":287,"minimalistic-crypto-utils":288}],192:[function(require,module,exports){ +},{"bn.js":189,"minimalistic-assert":285,"minimalistic-crypto-utils":286}],189:[function(require,module,exports){ arguments[4][18][0].apply(exports,arguments) -},{"buffer":73,"dup":18}],193:[function(require,module,exports){ +},{"buffer":67,"dup":18}],190:[function(require,module,exports){ module.exports={ - "name": "elliptic", - "version": "6.5.4", - "description": "EC cryptography", - "main": "lib/elliptic.js", - "files": [ - "lib" - ], - "scripts": { - "lint": "eslint lib test", - "lint:fix": "npm run lint -- --fix", - "unit": "istanbul test _mocha --reporter=spec test/index.js", - "test": "npm run lint && npm run unit", - "version": "grunt dist && git add dist/" + "_from": "elliptic@^6.5.3", + "_id": "elliptic@6.5.4", + "_inBundle": false, + "_integrity": "sha512-iLhC6ULemrljPZb+QutR5TQGB+pdW6KGD5RSegS+8sorOZT+rdQFbsQFJgvN3eRqNALqJer4oQ16YvJHlU8hzQ==", + "_location": "/elliptic", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "elliptic@^6.5.3", + "name": "elliptic", + "escapedName": "elliptic", + "rawSpec": "^6.5.3", + "saveSpec": null, + "fetchSpec": "^6.5.3" }, - "repository": { - "type": "git", - "url": "git@github.com:indutny/elliptic" - }, - "keywords": [ - "EC", - "Elliptic", - "curve", - "Cryptography" + "_requiredBy": [ + "/browserify-sign", + "/create-ecdh" ], - "author": "Fedor Indutny ", - "license": "MIT", + "_resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.4.tgz", + "_shasum": "da37cebd31e79a1367e941b592ed1fbebd58abbb", + "_spec": "elliptic@^6.5.3", + "_where": "/workspaces/TorrentParts/node_modules/browserify-sign", + "author": { + "name": "Fedor Indutny", + "email": "fedor@indutny.com" + }, "bugs": { "url": "https://github.com/indutny/elliptic/issues" }, - "homepage": "https://github.com/indutny/elliptic", + "bundleDependencies": false, + "dependencies": { + "bn.js": "^4.11.9", + "brorand": "^1.1.0", + "hash.js": "^1.0.0", + "hmac-drbg": "^1.0.1", + "inherits": "^2.0.4", + "minimalistic-assert": "^1.0.1", + "minimalistic-crypto-utils": "^1.0.1" + }, + "deprecated": false, + "description": "EC cryptography", "devDependencies": { "brfs": "^2.0.2", "coveralls": "^3.1.0", @@ -28765,18 +28896,34 @@ module.exports={ "istanbul": "^0.4.5", "mocha": "^8.0.1" }, - "dependencies": { - "bn.js": "^4.11.9", - "brorand": "^1.1.0", - "hash.js": "^1.0.0", - "hmac-drbg": "^1.0.1", - "inherits": "^2.0.4", - "minimalistic-assert": "^1.0.1", - "minimalistic-crypto-utils": "^1.0.1" - } + "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": { + "lint": "eslint lib test", + "lint:fix": "npm run lint -- --fix", + "test": "npm run lint && npm run unit", + "unit": "istanbul test _mocha --reporter=spec test/index.js", + "version": "grunt dist && git add dist/" + }, + "version": "6.5.4" } -},{}],194:[function(require,module,exports){ +},{}],191:[function(require,module,exports){ (function (process){(function (){ var once = require('once'); @@ -28874,7 +29021,7 @@ var eos = function(stream, opts, callback) { module.exports = eos; }).call(this)}).call(this,require('_process')) -},{"_process":342,"once":327}],195:[function(require,module,exports){ +},{"_process":341,"once":326}],192:[function(require,module,exports){ 'use strict'; /** @@ -28945,7 +29092,7 @@ function createError(err, code, props) { module.exports = createError; -},{}],196:[function(require,module,exports){ +},{}],193:[function(require,module,exports){ // Copyright Joyent, Inc. and other Node contributors. // // Permission is hereby granted, free of charge, to any person obtaining a @@ -29444,7 +29591,7 @@ function eventTargetAgnosticAddListener(emitter, name, listener, flags) { } } -},{}],197:[function(require,module,exports){ +},{}],194:[function(require,module,exports){ var Buffer = require('safe-buffer').Buffer var MD5 = require('md5.js') @@ -29491,7 +29638,7 @@ function EVP_BytesToKey (password, salt, keyBits, ivLen) { module.exports = EVP_BytesToKey -},{"md5.js":264,"safe-buffer":386}],198:[function(require,module,exports){ +},{"md5.js":258,"safe-buffer":383}],195:[function(require,module,exports){ module.exports = class FixedFIFO { constructor (hwm) { if (!(hwm > 0) || ((hwm - 1) & hwm) !== 0) throw new Error('Max size for a FixedFIFO should be a power of two') @@ -29522,7 +29669,7 @@ module.exports = class FixedFIFO { } } -},{}],199:[function(require,module,exports){ +},{}],196:[function(require,module,exports){ const FixedFIFO = require('./fixed-size') module.exports = class FastFIFO { @@ -29556,37 +29703,37 @@ module.exports = class FastFIFO { } } -},{"./fixed-size":198}],200:[function(require,module,exports){ +},{"./fixed-size":195}],197:[function(require,module,exports){ +arguments[4][29][0].apply(exports,arguments) +},{"dup":29}],198:[function(require,module,exports){ +arguments[4][30][0].apply(exports,arguments) +},{"./_stream_readable":200,"./_stream_writable":202,"_process":341,"dup":30,"inherits":246}],199:[function(require,module,exports){ +arguments[4][31][0].apply(exports,arguments) +},{"./_stream_transform":201,"dup":31,"inherits":246}],200:[function(require,module,exports){ arguments[4][32][0].apply(exports,arguments) -},{"dup":32}],201:[function(require,module,exports){ +},{"../errors":197,"./_stream_duplex":198,"./internal/streams/async_iterator":203,"./internal/streams/buffer_list":204,"./internal/streams/destroy":205,"./internal/streams/from":207,"./internal/streams/state":209,"./internal/streams/stream":210,"_process":341,"buffer":110,"dup":32,"events":193,"inherits":246,"string_decoder/":472,"util":67}],201:[function(require,module,exports){ arguments[4][33][0].apply(exports,arguments) -},{"./_stream_readable":203,"./_stream_writable":205,"_process":342,"dup":33,"inherits":249}],202:[function(require,module,exports){ +},{"../errors":197,"./_stream_duplex":198,"dup":33,"inherits":246}],202:[function(require,module,exports){ arguments[4][34][0].apply(exports,arguments) -},{"./_stream_transform":204,"dup":34,"inherits":249}],203:[function(require,module,exports){ +},{"../errors":197,"./_stream_duplex":198,"./internal/streams/destroy":205,"./internal/streams/state":209,"./internal/streams/stream":210,"_process":341,"buffer":110,"dup":34,"inherits":246,"util-deprecate":485}],203:[function(require,module,exports){ arguments[4][35][0].apply(exports,arguments) -},{"../errors":200,"./_stream_duplex":201,"./internal/streams/async_iterator":206,"./internal/streams/buffer_list":207,"./internal/streams/destroy":208,"./internal/streams/from":210,"./internal/streams/state":212,"./internal/streams/stream":213,"_process":342,"buffer":116,"dup":35,"events":196,"inherits":249,"string_decoder/":481,"util":73}],204:[function(require,module,exports){ +},{"./end-of-stream":206,"_process":341,"dup":35}],204:[function(require,module,exports){ arguments[4][36][0].apply(exports,arguments) -},{"../errors":200,"./_stream_duplex":201,"dup":36,"inherits":249}],205:[function(require,module,exports){ +},{"buffer":110,"dup":36,"util":67}],205:[function(require,module,exports){ arguments[4][37][0].apply(exports,arguments) -},{"../errors":200,"./_stream_duplex":201,"./internal/streams/destroy":208,"./internal/streams/state":212,"./internal/streams/stream":213,"_process":342,"buffer":116,"dup":37,"inherits":249,"util-deprecate":500}],206:[function(require,module,exports){ +},{"_process":341,"dup":37}],206:[function(require,module,exports){ arguments[4][38][0].apply(exports,arguments) -},{"./end-of-stream":209,"_process":342,"dup":38}],207:[function(require,module,exports){ +},{"../../../errors":197,"dup":38}],207:[function(require,module,exports){ arguments[4][39][0].apply(exports,arguments) -},{"buffer":116,"dup":39,"util":73}],208:[function(require,module,exports){ +},{"dup":39}],208:[function(require,module,exports){ arguments[4][40][0].apply(exports,arguments) -},{"_process":342,"dup":40}],209:[function(require,module,exports){ +},{"../../../errors":197,"./end-of-stream":206,"dup":40}],209:[function(require,module,exports){ arguments[4][41][0].apply(exports,arguments) -},{"../../../errors":200,"dup":41}],210:[function(require,module,exports){ +},{"../../../errors":197,"dup":41}],210:[function(require,module,exports){ arguments[4][42][0].apply(exports,arguments) -},{"dup":42}],211:[function(require,module,exports){ +},{"dup":42,"events":193}],211:[function(require,module,exports){ arguments[4][43][0].apply(exports,arguments) -},{"../../../errors":200,"./end-of-stream":209,"dup":43}],212:[function(require,module,exports){ -arguments[4][44][0].apply(exports,arguments) -},{"../../../errors":200,"dup":44}],213:[function(require,module,exports){ -arguments[4][45][0].apply(exports,arguments) -},{"dup":45,"events":196}],214:[function(require,module,exports){ -arguments[4][46][0].apply(exports,arguments) -},{"./lib/_stream_duplex.js":201,"./lib/_stream_passthrough.js":202,"./lib/_stream_readable.js":203,"./lib/_stream_transform.js":204,"./lib/_stream_writable.js":205,"./lib/internal/streams/end-of-stream.js":209,"./lib/internal/streams/pipeline.js":211,"dup":46}],215:[function(require,module,exports){ +},{"./lib/_stream_duplex.js":198,"./lib/_stream_passthrough.js":199,"./lib/_stream_readable.js":200,"./lib/_stream_transform.js":201,"./lib/_stream_writable.js":202,"./lib/internal/streams/end-of-stream.js":206,"./lib/internal/streams/pipeline.js":208,"dup":43}],212:[function(require,module,exports){ /* global FileReader */ const { Readable } = require('readable-stream') @@ -29672,7 +29819,7 @@ class FileReadStream extends Readable { module.exports = FileReadStream -},{"readable-stream":214,"typedarray-to-buffer":491}],216:[function(require,module,exports){ +},{"readable-stream":211,"typedarray-to-buffer":479}],213:[function(require,module,exports){ // originally pulled out of simple-peer module.exports = function getBrowserRTC () { @@ -29689,7 +29836,7 @@ module.exports = function getBrowserRTC () { return wrtc } -},{}],217:[function(require,module,exports){ +},{}],214:[function(require,module,exports){ 'use strict' var Buffer = require('safe-buffer').Buffer var Transform = require('readable-stream').Transform @@ -29786,37 +29933,37 @@ HashBase.prototype._digest = function () { module.exports = HashBase -},{"inherits":249,"readable-stream":232,"safe-buffer":386}],218:[function(require,module,exports){ +},{"inherits":246,"readable-stream":229,"safe-buffer":383}],215:[function(require,module,exports){ +arguments[4][29][0].apply(exports,arguments) +},{"dup":29}],216:[function(require,module,exports){ +arguments[4][30][0].apply(exports,arguments) +},{"./_stream_readable":218,"./_stream_writable":220,"_process":341,"dup":30,"inherits":246}],217:[function(require,module,exports){ +arguments[4][31][0].apply(exports,arguments) +},{"./_stream_transform":219,"dup":31,"inherits":246}],218:[function(require,module,exports){ arguments[4][32][0].apply(exports,arguments) -},{"dup":32}],219:[function(require,module,exports){ +},{"../errors":215,"./_stream_duplex":216,"./internal/streams/async_iterator":221,"./internal/streams/buffer_list":222,"./internal/streams/destroy":223,"./internal/streams/from":225,"./internal/streams/state":227,"./internal/streams/stream":228,"_process":341,"buffer":110,"dup":32,"events":193,"inherits":246,"string_decoder/":472,"util":67}],219:[function(require,module,exports){ arguments[4][33][0].apply(exports,arguments) -},{"./_stream_readable":221,"./_stream_writable":223,"_process":342,"dup":33,"inherits":249}],220:[function(require,module,exports){ +},{"../errors":215,"./_stream_duplex":216,"dup":33,"inherits":246}],220:[function(require,module,exports){ arguments[4][34][0].apply(exports,arguments) -},{"./_stream_transform":222,"dup":34,"inherits":249}],221:[function(require,module,exports){ +},{"../errors":215,"./_stream_duplex":216,"./internal/streams/destroy":223,"./internal/streams/state":227,"./internal/streams/stream":228,"_process":341,"buffer":110,"dup":34,"inherits":246,"util-deprecate":485}],221:[function(require,module,exports){ arguments[4][35][0].apply(exports,arguments) -},{"../errors":218,"./_stream_duplex":219,"./internal/streams/async_iterator":224,"./internal/streams/buffer_list":225,"./internal/streams/destroy":226,"./internal/streams/from":228,"./internal/streams/state":230,"./internal/streams/stream":231,"_process":342,"buffer":116,"dup":35,"events":196,"inherits":249,"string_decoder/":481,"util":73}],222:[function(require,module,exports){ +},{"./end-of-stream":224,"_process":341,"dup":35}],222:[function(require,module,exports){ arguments[4][36][0].apply(exports,arguments) -},{"../errors":218,"./_stream_duplex":219,"dup":36,"inherits":249}],223:[function(require,module,exports){ +},{"buffer":110,"dup":36,"util":67}],223:[function(require,module,exports){ arguments[4][37][0].apply(exports,arguments) -},{"../errors":218,"./_stream_duplex":219,"./internal/streams/destroy":226,"./internal/streams/state":230,"./internal/streams/stream":231,"_process":342,"buffer":116,"dup":37,"inherits":249,"util-deprecate":500}],224:[function(require,module,exports){ +},{"_process":341,"dup":37}],224:[function(require,module,exports){ arguments[4][38][0].apply(exports,arguments) -},{"./end-of-stream":227,"_process":342,"dup":38}],225:[function(require,module,exports){ +},{"../../../errors":215,"dup":38}],225:[function(require,module,exports){ arguments[4][39][0].apply(exports,arguments) -},{"buffer":116,"dup":39,"util":73}],226:[function(require,module,exports){ +},{"dup":39}],226:[function(require,module,exports){ arguments[4][40][0].apply(exports,arguments) -},{"_process":342,"dup":40}],227:[function(require,module,exports){ +},{"../../../errors":215,"./end-of-stream":224,"dup":40}],227:[function(require,module,exports){ arguments[4][41][0].apply(exports,arguments) -},{"../../../errors":218,"dup":41}],228:[function(require,module,exports){ +},{"../../../errors":215,"dup":41}],228:[function(require,module,exports){ arguments[4][42][0].apply(exports,arguments) -},{"dup":42}],229:[function(require,module,exports){ +},{"dup":42,"events":193}],229:[function(require,module,exports){ arguments[4][43][0].apply(exports,arguments) -},{"../../../errors":218,"./end-of-stream":227,"dup":43}],230:[function(require,module,exports){ -arguments[4][44][0].apply(exports,arguments) -},{"../../../errors":218,"dup":44}],231:[function(require,module,exports){ -arguments[4][45][0].apply(exports,arguments) -},{"dup":45,"events":196}],232:[function(require,module,exports){ -arguments[4][46][0].apply(exports,arguments) -},{"./lib/_stream_duplex.js":219,"./lib/_stream_passthrough.js":220,"./lib/_stream_readable.js":221,"./lib/_stream_transform.js":222,"./lib/_stream_writable.js":223,"./lib/internal/streams/end-of-stream.js":227,"./lib/internal/streams/pipeline.js":229,"dup":46}],233:[function(require,module,exports){ +},{"./lib/_stream_duplex.js":216,"./lib/_stream_passthrough.js":217,"./lib/_stream_readable.js":218,"./lib/_stream_transform.js":219,"./lib/_stream_writable.js":220,"./lib/internal/streams/end-of-stream.js":224,"./lib/internal/streams/pipeline.js":226,"dup":43}],230:[function(require,module,exports){ var hash = exports; hash.utils = require('./hash/utils'); @@ -29833,7 +29980,7 @@ hash.sha384 = hash.sha.sha384; hash.sha512 = hash.sha.sha512; hash.ripemd160 = hash.ripemd.ripemd160; -},{"./hash/common":234,"./hash/hmac":235,"./hash/ripemd":236,"./hash/sha":237,"./hash/utils":244}],234:[function(require,module,exports){ +},{"./hash/common":231,"./hash/hmac":232,"./hash/ripemd":233,"./hash/sha":234,"./hash/utils":241}],231:[function(require,module,exports){ 'use strict'; var utils = require('./utils'); @@ -29927,7 +30074,7 @@ BlockHash.prototype._pad = function pad() { return res; }; -},{"./utils":244,"minimalistic-assert":287}],235:[function(require,module,exports){ +},{"./utils":241,"minimalistic-assert":285}],232:[function(require,module,exports){ 'use strict'; var utils = require('./utils'); @@ -29976,7 +30123,7 @@ Hmac.prototype.digest = function digest(enc) { return this.outer.digest(enc); }; -},{"./utils":244,"minimalistic-assert":287}],236:[function(require,module,exports){ +},{"./utils":241,"minimalistic-assert":285}],233:[function(require,module,exports){ 'use strict'; var utils = require('./utils'); @@ -30124,7 +30271,7 @@ var sh = [ 8, 5, 12, 9, 12, 5, 14, 6, 8, 13, 6, 5, 15, 13, 11, 11 ]; -},{"./common":234,"./utils":244}],237:[function(require,module,exports){ +},{"./common":231,"./utils":241}],234:[function(require,module,exports){ 'use strict'; exports.sha1 = require('./sha/1'); @@ -30133,7 +30280,7 @@ exports.sha256 = require('./sha/256'); exports.sha384 = require('./sha/384'); exports.sha512 = require('./sha/512'); -},{"./sha/1":238,"./sha/224":239,"./sha/256":240,"./sha/384":241,"./sha/512":242}],238:[function(require,module,exports){ +},{"./sha/1":235,"./sha/224":236,"./sha/256":237,"./sha/384":238,"./sha/512":239}],235:[function(require,module,exports){ 'use strict'; var utils = require('../utils'); @@ -30209,7 +30356,7 @@ SHA1.prototype._digest = function digest(enc) { return utils.split32(this.h, 'big'); }; -},{"../common":234,"../utils":244,"./common":243}],239:[function(require,module,exports){ +},{"../common":231,"../utils":241,"./common":240}],236:[function(require,module,exports){ 'use strict'; var utils = require('../utils'); @@ -30241,7 +30388,7 @@ SHA224.prototype._digest = function digest(enc) { }; -},{"../utils":244,"./256":240}],240:[function(require,module,exports){ +},{"../utils":241,"./256":237}],237:[function(require,module,exports){ 'use strict'; var utils = require('../utils'); @@ -30348,7 +30495,7 @@ SHA256.prototype._digest = function digest(enc) { return utils.split32(this.h, 'big'); }; -},{"../common":234,"../utils":244,"./common":243,"minimalistic-assert":287}],241:[function(require,module,exports){ +},{"../common":231,"../utils":241,"./common":240,"minimalistic-assert":285}],238:[function(require,module,exports){ 'use strict'; var utils = require('../utils'); @@ -30385,7 +30532,7 @@ SHA384.prototype._digest = function digest(enc) { return utils.split32(this.h.slice(0, 12), 'big'); }; -},{"../utils":244,"./512":242}],242:[function(require,module,exports){ +},{"../utils":241,"./512":239}],239:[function(require,module,exports){ 'use strict'; var utils = require('../utils'); @@ -30717,7 +30864,7 @@ function g1_512_lo(xh, xl) { return r; } -},{"../common":234,"../utils":244,"minimalistic-assert":287}],243:[function(require,module,exports){ +},{"../common":231,"../utils":241,"minimalistic-assert":285}],240:[function(require,module,exports){ 'use strict'; var utils = require('../utils'); @@ -30768,7 +30915,7 @@ function g1_256(x) { } exports.g1_256 = g1_256; -},{"../utils":244}],244:[function(require,module,exports){ +},{"../utils":241}],241:[function(require,module,exports){ 'use strict'; var assert = require('minimalistic-assert'); @@ -31048,7 +31195,7 @@ function shr64_lo(ah, al, num) { } exports.shr64_lo = shr64_lo; -},{"inherits":249,"minimalistic-assert":287}],245:[function(require,module,exports){ +},{"inherits":246,"minimalistic-assert":285}],242:[function(require,module,exports){ 'use strict'; var hash = require('hash.js'); @@ -31163,7 +31310,7 @@ HmacDRBG.prototype.generate = function generate(len, enc, add, addEnc) { return utils.encode(res, enc); }; -},{"hash.js":233,"minimalistic-assert":287,"minimalistic-crypto-utils":288}],246:[function(require,module,exports){ +},{"hash.js":230,"minimalistic-assert":285,"minimalistic-crypto-utils":286}],243:[function(require,module,exports){ var http = require('http') var url = require('url') @@ -31196,7 +31343,7 @@ function validateParams (params) { return params } -},{"http":458,"url":494}],247:[function(require,module,exports){ +},{"http":449,"url":482}],244:[function(require,module,exports){ /*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh */ exports.read = function (buffer, offset, isLE, mLen, nBytes) { var e, m @@ -31283,7 +31430,7 @@ exports.write = function (buffer, value, offset, isLE, mLen, nBytes) { buffer[offset + i - d] |= s * 128 } -},{}],248:[function(require,module,exports){ +},{}],245:[function(require,module,exports){ /*! immediate-chunk-store. MIT License. Feross Aboukhadijeh */ // TODO: remove when window.queueMicrotask() is well supported const queueMicrotask = require('queue-microtask') @@ -31340,7 +31487,7 @@ class ImmediateStore { module.exports = ImmediateStore -},{"queue-microtask":355}],249:[function(require,module,exports){ +},{"queue-microtask":354}],246:[function(require,module,exports){ if (typeof Object.create === 'function') { // implementation from standard node.js 'util' module module.exports = function inherits(ctor, superCtor) { @@ -31369,7 +31516,7 @@ if (typeof Object.create === 'function') { } } -},{}],250:[function(require,module,exports){ +},{}],247:[function(require,module,exports){ /* (c) 2016 Ari Porad (@ariporad) . License: ariporad.mit-license.org */ // Partially from http://stackoverflow.com/a/94049/1928484, and from another SO answer, which told me that the highest @@ -31384,7 +31531,7 @@ module.exports = function isAscii(str) { return true; }; -},{}],251:[function(require,module,exports){ +},{}],248:[function(require,module,exports){ /*! * Determine if an object is a Buffer * @@ -31407,7 +31554,7 @@ function isSlowBuffer (obj) { return typeof obj.readFloatLE === 'function' && typeof obj.slice === 'function' && isBuffer(obj.slice(0, 0)) } -},{}],252:[function(require,module,exports){ +},{}],249:[function(require,module,exports){ module.exports = isTypedArray isTypedArray.strict = isStrictTypedArray isTypedArray.loose = isLooseTypedArray @@ -31450,7 +31597,7 @@ function isLooseTypedArray(arr) { return names[toString.call(arr)] } -},{}],253:[function(require,module,exports){ +},{}],250:[function(require,module,exports){ 'use strict'; const blacklist = [ @@ -31491,12 +31638,12 @@ exports.not = filename => !exports.is(filename); // TODO: Remove this for the next major release exports.default = module.exports; -},{}],254:[function(require,module,exports){ +},{}],251:[function(require,module,exports){ exports.RateLimiter = require('./lib/rateLimiter'); exports.TokenBucket = require('./lib/tokenBucket'); -},{"./lib/rateLimiter":256,"./lib/tokenBucket":257}],255:[function(require,module,exports){ +},{"./lib/rateLimiter":253,"./lib/tokenBucket":254}],252:[function(require,module,exports){ (function (process){(function (){ var getMilliseconds = function() { if (typeof process !== 'undefined' && process.hrtime) { @@ -31513,7 +31660,7 @@ var getMilliseconds = function() { module.exports = getMilliseconds; }).call(this)}).call(this,require('_process')) -},{"_process":342}],256:[function(require,module,exports){ +},{"_process":341}],253:[function(require,module,exports){ (function (process){(function (){ var TokenBucket = require('./tokenBucket'); var getMilliseconds = require('./clock'); @@ -31654,7 +31801,7 @@ RateLimiter.prototype = { module.exports = RateLimiter; }).call(this)}).call(this,require('_process')) -},{"./clock":255,"./tokenBucket":257,"_process":342}],257:[function(require,module,exports){ +},{"./clock":252,"./tokenBucket":254,"_process":341}],254:[function(require,module,exports){ (function (process){(function (){ /** @@ -31825,7 +31972,7 @@ TokenBucket.prototype = { module.exports = TokenBucket; }).call(this)}).call(this,require('_process')) -},{"_process":342}],258:[function(require,module,exports){ +},{"_process":341}],255:[function(require,module,exports){ var events = require('events') var inherits = require('inherits') @@ -31972,7 +32119,7 @@ LRU.prototype.evict = function () { this.emit('evict', {key: key, value: value}) } -},{"events":196,"inherits":249}],259:[function(require,module,exports){ +},{"events":193,"inherits":246}],256:[function(require,module,exports){ (function (Buffer){(function (){ /*! lt_donthave. MIT License. WebTorrent LLC */ const arrayRemove = require('unordered-array-remove') @@ -32039,13 +32186,7 @@ module.exports = () => { } }).call(this)}).call(this,require("buffer").Buffer) -},{"buffer":116,"debug":260,"events":196,"unordered-array-remove":493}],260:[function(require,module,exports){ -arguments[4][29][0].apply(exports,arguments) -},{"./common":261,"_process":342,"dup":29}],261:[function(require,module,exports){ -arguments[4][30][0].apply(exports,arguments) -},{"dup":30,"ms":262}],262:[function(require,module,exports){ -arguments[4][31][0].apply(exports,arguments) -},{"dup":31}],263:[function(require,module,exports){ +},{"buffer":110,"debug":161,"events":193,"unordered-array-remove":481}],257:[function(require,module,exports){ (function (Buffer){(function (){ /*! magnet-uri. MIT License. WebTorrent LLC */ module.exports = magnetURIDecode @@ -32226,7 +32367,7 @@ function magnetURIEncode (obj) { } }).call(this)}).call(this,require("buffer").Buffer) -},{"bep53-range":25,"buffer":116,"thirty-two":482}],264:[function(require,module,exports){ +},{"bep53-range":25,"buffer":110,"thirty-two":473}],258:[function(require,module,exports){ 'use strict' var inherits = require('inherits') var HashBase = require('hash-base') @@ -32374,7 +32515,7 @@ function fnI (a, b, c, d, m, k, s) { module.exports = MD5 -},{"hash-base":217,"inherits":249,"safe-buffer":386}],265:[function(require,module,exports){ +},{"hash-base":214,"inherits":246,"safe-buffer":383}],259:[function(require,module,exports){ /*! mediasource. MIT License. Feross Aboukhadijeh */ module.exports = MediaElementWrapper @@ -32666,37 +32807,37 @@ function downloadBuffers (bufs, name) { a.click() } -},{"inherits":249,"readable-stream":280,"to-arraybuffer":485}],266:[function(require,module,exports){ +},{"inherits":246,"readable-stream":274,"to-arraybuffer":476}],260:[function(require,module,exports){ +arguments[4][29][0].apply(exports,arguments) +},{"dup":29}],261:[function(require,module,exports){ +arguments[4][30][0].apply(exports,arguments) +},{"./_stream_readable":263,"./_stream_writable":265,"_process":341,"dup":30,"inherits":246}],262:[function(require,module,exports){ +arguments[4][31][0].apply(exports,arguments) +},{"./_stream_transform":264,"dup":31,"inherits":246}],263:[function(require,module,exports){ arguments[4][32][0].apply(exports,arguments) -},{"dup":32}],267:[function(require,module,exports){ +},{"../errors":260,"./_stream_duplex":261,"./internal/streams/async_iterator":266,"./internal/streams/buffer_list":267,"./internal/streams/destroy":268,"./internal/streams/from":270,"./internal/streams/state":272,"./internal/streams/stream":273,"_process":341,"buffer":110,"dup":32,"events":193,"inherits":246,"string_decoder/":472,"util":67}],264:[function(require,module,exports){ arguments[4][33][0].apply(exports,arguments) -},{"./_stream_readable":269,"./_stream_writable":271,"_process":342,"dup":33,"inherits":249}],268:[function(require,module,exports){ +},{"../errors":260,"./_stream_duplex":261,"dup":33,"inherits":246}],265:[function(require,module,exports){ arguments[4][34][0].apply(exports,arguments) -},{"./_stream_transform":270,"dup":34,"inherits":249}],269:[function(require,module,exports){ +},{"../errors":260,"./_stream_duplex":261,"./internal/streams/destroy":268,"./internal/streams/state":272,"./internal/streams/stream":273,"_process":341,"buffer":110,"dup":34,"inherits":246,"util-deprecate":485}],266:[function(require,module,exports){ arguments[4][35][0].apply(exports,arguments) -},{"../errors":266,"./_stream_duplex":267,"./internal/streams/async_iterator":272,"./internal/streams/buffer_list":273,"./internal/streams/destroy":274,"./internal/streams/from":276,"./internal/streams/state":278,"./internal/streams/stream":279,"_process":342,"buffer":116,"dup":35,"events":196,"inherits":249,"string_decoder/":481,"util":73}],270:[function(require,module,exports){ +},{"./end-of-stream":269,"_process":341,"dup":35}],267:[function(require,module,exports){ arguments[4][36][0].apply(exports,arguments) -},{"../errors":266,"./_stream_duplex":267,"dup":36,"inherits":249}],271:[function(require,module,exports){ +},{"buffer":110,"dup":36,"util":67}],268:[function(require,module,exports){ arguments[4][37][0].apply(exports,arguments) -},{"../errors":266,"./_stream_duplex":267,"./internal/streams/destroy":274,"./internal/streams/state":278,"./internal/streams/stream":279,"_process":342,"buffer":116,"dup":37,"inherits":249,"util-deprecate":500}],272:[function(require,module,exports){ +},{"_process":341,"dup":37}],269:[function(require,module,exports){ arguments[4][38][0].apply(exports,arguments) -},{"./end-of-stream":275,"_process":342,"dup":38}],273:[function(require,module,exports){ +},{"../../../errors":260,"dup":38}],270:[function(require,module,exports){ arguments[4][39][0].apply(exports,arguments) -},{"buffer":116,"dup":39,"util":73}],274:[function(require,module,exports){ +},{"dup":39}],271:[function(require,module,exports){ arguments[4][40][0].apply(exports,arguments) -},{"_process":342,"dup":40}],275:[function(require,module,exports){ +},{"../../../errors":260,"./end-of-stream":269,"dup":40}],272:[function(require,module,exports){ arguments[4][41][0].apply(exports,arguments) -},{"../../../errors":266,"dup":41}],276:[function(require,module,exports){ +},{"../../../errors":260,"dup":41}],273:[function(require,module,exports){ arguments[4][42][0].apply(exports,arguments) -},{"dup":42}],277:[function(require,module,exports){ +},{"dup":42,"events":193}],274:[function(require,module,exports){ arguments[4][43][0].apply(exports,arguments) -},{"../../../errors":266,"./end-of-stream":275,"dup":43}],278:[function(require,module,exports){ -arguments[4][44][0].apply(exports,arguments) -},{"../../../errors":266,"dup":44}],279:[function(require,module,exports){ -arguments[4][45][0].apply(exports,arguments) -},{"dup":45,"events":196}],280:[function(require,module,exports){ -arguments[4][46][0].apply(exports,arguments) -},{"./lib/_stream_duplex.js":267,"./lib/_stream_passthrough.js":268,"./lib/_stream_readable.js":269,"./lib/_stream_transform.js":270,"./lib/_stream_writable.js":271,"./lib/internal/streams/end-of-stream.js":275,"./lib/internal/streams/pipeline.js":277,"dup":46}],281:[function(require,module,exports){ +},{"./lib/_stream_duplex.js":261,"./lib/_stream_passthrough.js":262,"./lib/_stream_readable.js":263,"./lib/_stream_transform.js":264,"./lib/_stream_writable.js":265,"./lib/internal/streams/end-of-stream.js":269,"./lib/internal/streams/pipeline.js":271,"dup":43}],275:[function(require,module,exports){ module.exports = Storage const queueMicrotask = require('queue-microtask') @@ -32763,7 +32904,7 @@ Storage.prototype.close = Storage.prototype.destroy = function (cb = () => {}) { queueMicrotask(() => cb(null)) } -},{"queue-microtask":355}],282:[function(require,module,exports){ +},{"queue-microtask":354}],276:[function(require,module,exports){ var bn = require('bn.js'); var brorand = require('brorand'); @@ -32880,9 +33021,9 @@ MillerRabin.prototype.getDivisor = function getDivisor(n, k) { return false; }; -},{"bn.js":283,"brorand":72}],283:[function(require,module,exports){ +},{"bn.js":277,"brorand":66}],277:[function(require,module,exports){ arguments[4][18][0].apply(exports,arguments) -},{"buffer":73,"dup":18}],284:[function(require,module,exports){ +},{"buffer":67,"dup":18}],278:[function(require,module,exports){ module.exports={ "application/1d-interleaved-parityfec": { "source": "iana" @@ -32907,6 +33048,9 @@ module.exports={ "application/a2l": { "source": "iana" }, + "application/ace+cbor": { + "source": "iana" + }, "application/activemessage": { "source": "iana" }, @@ -32976,6 +33120,9 @@ module.exports={ "source": "apache", "extensions": ["aw"] }, + "application/at+jwt": { + "source": "iana" + }, "application/atf": { "source": "iana" }, @@ -33376,6 +33523,10 @@ module.exports={ "source": "iana", "compressible": true }, + "application/express": { + "source": "iana", + "extensions": ["exp"] + }, "application/fastinfoset": { "source": "iana" }, @@ -33951,6 +34102,9 @@ module.exports={ "source": "iana", "extensions": ["oxps"] }, + "application/p21": { + "source": "iana" + }, "application/p21+zip": { "source": "iana", "compressible": false @@ -34525,6 +34679,9 @@ module.exports={ "application/tnauthlist": { "source": "iana" }, + "application/token-introspection+jwt": { + "source": "iana" + }, "application/toml": { "compressible": true, "extensions": ["toml"] @@ -38680,6 +38837,15 @@ module.exports={ "source": "apache", "extensions": ["iso"] }, + "application/x-iwork-keynote-sffkey": { + "extensions": ["key"] + }, + "application/x-iwork-numbers-sffnumbers": { + "extensions": ["numbers"] + }, + "application/x-iwork-pages-sffpages": { + "extensions": ["pages"] + }, "application/x-java-archive-diff": { "source": "nginx", "extensions": ["jardiff"] @@ -40311,6 +40477,14 @@ module.exports={ "source": "iana", "extensions": ["obj"] }, + "model/step": { + "source": "iana" + }, + "model/step+xml": { + "source": "iana", + "compressible": true, + "extensions": ["stpx"] + }, "model/step+zip": { "source": "iana", "compressible": false, @@ -41011,6 +41185,9 @@ module.exports={ "source": "apache", "extensions": ["jpm","jpgm"] }, + "video/jxsv": { + "source": "iana" + }, "video/mj2": { "source": "iana", "extensions": ["mj2","mjp2"] @@ -41301,7 +41478,7 @@ module.exports={ } } -},{}],285:[function(require,module,exports){ +},{}],279:[function(require,module,exports){ /*! * mime-db * Copyright(c) 2014 Jonathan Ong @@ -41314,7 +41491,7 @@ module.exports={ module.exports = require('./db.json') -},{"./db.json":284}],286:[function(require,module,exports){ +},{"./db.json":278}],280:[function(require,module,exports){ /*! * mime-types * Copyright(c) 2014 Jonathan Ong @@ -41504,7 +41681,116 @@ function populateMaps (extensions, types) { }) } -},{"mime-db":285,"path":334}],287:[function(require,module,exports){ +},{"mime-db":279,"path":333}],281:[function(require,module,exports){ +'use strict'; + +/** + * @param typeMap [Object] Map of MIME type -> Array[extensions] + * @param ... + */ +function Mime() { + this._types = Object.create(null); + this._extensions = Object.create(null); + + for (let i = 0; i < arguments.length; i++) { + this.define(arguments[i]); + } + + this.define = this.define.bind(this); + this.getType = this.getType.bind(this); + this.getExtension = this.getExtension.bind(this); +} + +/** + * Define mimetype -> extension mappings. Each key is a mime-type that maps + * to an array of extensions associated with the type. The first extension is + * used as the default extension for the type. + * + * e.g. mime.define({'audio/ogg', ['oga', 'ogg', 'spx']}); + * + * If a type declares an extension that has already been defined, an error will + * be thrown. To suppress this error and force the extension to be associated + * with the new type, pass `force`=true. Alternatively, you may prefix the + * extension with "*" to map the type to extension, without mapping the + * extension to the type. + * + * e.g. mime.define({'audio/wav', ['wav']}, {'audio/x-wav', ['*wav']}); + * + * + * @param map (Object) type definitions + * @param force (Boolean) if true, force overriding of existing definitions + */ +Mime.prototype.define = function(typeMap, force) { + for (let type in typeMap) { + let extensions = typeMap[type].map(function(t) { + return t.toLowerCase(); + }); + type = type.toLowerCase(); + + for (let i = 0; i < extensions.length; i++) { + const ext = extensions[i]; + + // '*' prefix = not the preferred type for this extension. So fixup the + // extension, and skip it. + if (ext[0] === '*') { + continue; + } + + if (!force && (ext in this._types)) { + throw new Error( + 'Attempt to change mapping for "' + ext + + '" extension from "' + this._types[ext] + '" to "' + type + + '". Pass `force=true` to allow this, otherwise remove "' + ext + + '" from the list of extensions for "' + type + '".' + ); + } + + this._types[ext] = type; + } + + // Use first extension as default + if (force || !this._extensions[type]) { + const ext = extensions[0]; + this._extensions[type] = (ext[0] !== '*') ? ext : ext.substr(1); + } + } +}; + +/** + * Lookup a mime type based on extension + */ +Mime.prototype.getType = function(path) { + path = String(path); + let last = path.replace(/^.*[/\\]/, '').toLowerCase(); + let ext = last.replace(/^.*\./, '').toLowerCase(); + + let hasPath = last.length < path.length; + let hasDot = ext.length < last.length - 1; + + return (hasDot || !hasPath) && this._types[ext] || null; +}; + +/** + * Return file extension associated with a mime type + */ +Mime.prototype.getExtension = function(type) { + type = /^\s*([^;\s]*)/.test(type) && RegExp.$1; + return type && this._extensions[type.toLowerCase()] || null; +}; + +module.exports = Mime; + +},{}],282:[function(require,module,exports){ +'use strict'; + +let Mime = require('./Mime'); +module.exports = new Mime(require('./types/standard'), require('./types/other')); + +},{"./Mime":281,"./types/other":283,"./types/standard":284}],283:[function(require,module,exports){ +module.exports = {"application/prs.cww":["cww"],"application/vnd.1000minds.decision-model+xml":["1km"],"application/vnd.3gpp.pic-bw-large":["plb"],"application/vnd.3gpp.pic-bw-small":["psb"],"application/vnd.3gpp.pic-bw-var":["pvb"],"application/vnd.3gpp2.tcap":["tcap"],"application/vnd.3m.post-it-notes":["pwn"],"application/vnd.accpac.simply.aso":["aso"],"application/vnd.accpac.simply.imp":["imp"],"application/vnd.acucobol":["acu"],"application/vnd.acucorp":["atc","acutc"],"application/vnd.adobe.air-application-installer-package+zip":["air"],"application/vnd.adobe.formscentral.fcdt":["fcdt"],"application/vnd.adobe.fxp":["fxp","fxpl"],"application/vnd.adobe.xdp+xml":["xdp"],"application/vnd.adobe.xfdf":["xfdf"],"application/vnd.ahead.space":["ahead"],"application/vnd.airzip.filesecure.azf":["azf"],"application/vnd.airzip.filesecure.azs":["azs"],"application/vnd.amazon.ebook":["azw"],"application/vnd.americandynamics.acc":["acc"],"application/vnd.amiga.ami":["ami"],"application/vnd.android.package-archive":["apk"],"application/vnd.anser-web-certificate-issue-initiation":["cii"],"application/vnd.anser-web-funds-transfer-initiation":["fti"],"application/vnd.antix.game-component":["atx"],"application/vnd.apple.installer+xml":["mpkg"],"application/vnd.apple.keynote":["key"],"application/vnd.apple.mpegurl":["m3u8"],"application/vnd.apple.numbers":["numbers"],"application/vnd.apple.pages":["pages"],"application/vnd.apple.pkpass":["pkpass"],"application/vnd.aristanetworks.swi":["swi"],"application/vnd.astraea-software.iota":["iota"],"application/vnd.audiograph":["aep"],"application/vnd.balsamiq.bmml+xml":["bmml"],"application/vnd.blueice.multipass":["mpm"],"application/vnd.bmi":["bmi"],"application/vnd.businessobjects":["rep"],"application/vnd.chemdraw+xml":["cdxml"],"application/vnd.chipnuts.karaoke-mmd":["mmd"],"application/vnd.cinderella":["cdy"],"application/vnd.citationstyles.style+xml":["csl"],"application/vnd.claymore":["cla"],"application/vnd.cloanto.rp9":["rp9"],"application/vnd.clonk.c4group":["c4g","c4d","c4f","c4p","c4u"],"application/vnd.cluetrust.cartomobile-config":["c11amc"],"application/vnd.cluetrust.cartomobile-config-pkg":["c11amz"],"application/vnd.commonspace":["csp"],"application/vnd.contact.cmsg":["cdbcmsg"],"application/vnd.cosmocaller":["cmc"],"application/vnd.crick.clicker":["clkx"],"application/vnd.crick.clicker.keyboard":["clkk"],"application/vnd.crick.clicker.palette":["clkp"],"application/vnd.crick.clicker.template":["clkt"],"application/vnd.crick.clicker.wordbank":["clkw"],"application/vnd.criticaltools.wbs+xml":["wbs"],"application/vnd.ctc-posml":["pml"],"application/vnd.cups-ppd":["ppd"],"application/vnd.curl.car":["car"],"application/vnd.curl.pcurl":["pcurl"],"application/vnd.dart":["dart"],"application/vnd.data-vision.rdz":["rdz"],"application/vnd.dbf":["dbf"],"application/vnd.dece.data":["uvf","uvvf","uvd","uvvd"],"application/vnd.dece.ttml+xml":["uvt","uvvt"],"application/vnd.dece.unspecified":["uvx","uvvx"],"application/vnd.dece.zip":["uvz","uvvz"],"application/vnd.denovo.fcselayout-link":["fe_launch"],"application/vnd.dna":["dna"],"application/vnd.dolby.mlp":["mlp"],"application/vnd.dpgraph":["dpg"],"application/vnd.dreamfactory":["dfac"],"application/vnd.ds-keypoint":["kpxx"],"application/vnd.dvb.ait":["ait"],"application/vnd.dvb.service":["svc"],"application/vnd.dynageo":["geo"],"application/vnd.ecowin.chart":["mag"],"application/vnd.enliven":["nml"],"application/vnd.epson.esf":["esf"],"application/vnd.epson.msf":["msf"],"application/vnd.epson.quickanime":["qam"],"application/vnd.epson.salt":["slt"],"application/vnd.epson.ssf":["ssf"],"application/vnd.eszigno3+xml":["es3","et3"],"application/vnd.ezpix-album":["ez2"],"application/vnd.ezpix-package":["ez3"],"application/vnd.fdf":["fdf"],"application/vnd.fdsn.mseed":["mseed"],"application/vnd.fdsn.seed":["seed","dataless"],"application/vnd.flographit":["gph"],"application/vnd.fluxtime.clip":["ftc"],"application/vnd.framemaker":["fm","frame","maker","book"],"application/vnd.frogans.fnc":["fnc"],"application/vnd.frogans.ltf":["ltf"],"application/vnd.fsc.weblaunch":["fsc"],"application/vnd.fujitsu.oasys":["oas"],"application/vnd.fujitsu.oasys2":["oa2"],"application/vnd.fujitsu.oasys3":["oa3"],"application/vnd.fujitsu.oasysgp":["fg5"],"application/vnd.fujitsu.oasysprs":["bh2"],"application/vnd.fujixerox.ddd":["ddd"],"application/vnd.fujixerox.docuworks":["xdw"],"application/vnd.fujixerox.docuworks.binder":["xbd"],"application/vnd.fuzzysheet":["fzs"],"application/vnd.genomatix.tuxedo":["txd"],"application/vnd.geogebra.file":["ggb"],"application/vnd.geogebra.tool":["ggt"],"application/vnd.geometry-explorer":["gex","gre"],"application/vnd.geonext":["gxt"],"application/vnd.geoplan":["g2w"],"application/vnd.geospace":["g3w"],"application/vnd.gmx":["gmx"],"application/vnd.google-apps.document":["gdoc"],"application/vnd.google-apps.presentation":["gslides"],"application/vnd.google-apps.spreadsheet":["gsheet"],"application/vnd.google-earth.kml+xml":["kml"],"application/vnd.google-earth.kmz":["kmz"],"application/vnd.grafeq":["gqf","gqs"],"application/vnd.groove-account":["gac"],"application/vnd.groove-help":["ghf"],"application/vnd.groove-identity-message":["gim"],"application/vnd.groove-injector":["grv"],"application/vnd.groove-tool-message":["gtm"],"application/vnd.groove-tool-template":["tpl"],"application/vnd.groove-vcard":["vcg"],"application/vnd.hal+xml":["hal"],"application/vnd.handheld-entertainment+xml":["zmm"],"application/vnd.hbci":["hbci"],"application/vnd.hhe.lesson-player":["les"],"application/vnd.hp-hpgl":["hpgl"],"application/vnd.hp-hpid":["hpid"],"application/vnd.hp-hps":["hps"],"application/vnd.hp-jlyt":["jlt"],"application/vnd.hp-pcl":["pcl"],"application/vnd.hp-pclxl":["pclxl"],"application/vnd.hydrostatix.sof-data":["sfd-hdstx"],"application/vnd.ibm.minipay":["mpy"],"application/vnd.ibm.modcap":["afp","listafp","list3820"],"application/vnd.ibm.rights-management":["irm"],"application/vnd.ibm.secure-container":["sc"],"application/vnd.iccprofile":["icc","icm"],"application/vnd.igloader":["igl"],"application/vnd.immervision-ivp":["ivp"],"application/vnd.immervision-ivu":["ivu"],"application/vnd.insors.igm":["igm"],"application/vnd.intercon.formnet":["xpw","xpx"],"application/vnd.intergeo":["i2g"],"application/vnd.intu.qbo":["qbo"],"application/vnd.intu.qfx":["qfx"],"application/vnd.ipunplugged.rcprofile":["rcprofile"],"application/vnd.irepository.package+xml":["irp"],"application/vnd.is-xpr":["xpr"],"application/vnd.isac.fcs":["fcs"],"application/vnd.jam":["jam"],"application/vnd.jcp.javame.midlet-rms":["rms"],"application/vnd.jisp":["jisp"],"application/vnd.joost.joda-archive":["joda"],"application/vnd.kahootz":["ktz","ktr"],"application/vnd.kde.karbon":["karbon"],"application/vnd.kde.kchart":["chrt"],"application/vnd.kde.kformula":["kfo"],"application/vnd.kde.kivio":["flw"],"application/vnd.kde.kontour":["kon"],"application/vnd.kde.kpresenter":["kpr","kpt"],"application/vnd.kde.kspread":["ksp"],"application/vnd.kde.kword":["kwd","kwt"],"application/vnd.kenameaapp":["htke"],"application/vnd.kidspiration":["kia"],"application/vnd.kinar":["kne","knp"],"application/vnd.koan":["skp","skd","skt","skm"],"application/vnd.kodak-descriptor":["sse"],"application/vnd.las.las+xml":["lasxml"],"application/vnd.llamagraphics.life-balance.desktop":["lbd"],"application/vnd.llamagraphics.life-balance.exchange+xml":["lbe"],"application/vnd.lotus-1-2-3":["123"],"application/vnd.lotus-approach":["apr"],"application/vnd.lotus-freelance":["pre"],"application/vnd.lotus-notes":["nsf"],"application/vnd.lotus-organizer":["org"],"application/vnd.lotus-screencam":["scm"],"application/vnd.lotus-wordpro":["lwp"],"application/vnd.macports.portpkg":["portpkg"],"application/vnd.mcd":["mcd"],"application/vnd.medcalcdata":["mc1"],"application/vnd.mediastation.cdkey":["cdkey"],"application/vnd.mfer":["mwf"],"application/vnd.mfmp":["mfm"],"application/vnd.micrografx.flo":["flo"],"application/vnd.micrografx.igx":["igx"],"application/vnd.mif":["mif"],"application/vnd.mobius.daf":["daf"],"application/vnd.mobius.dis":["dis"],"application/vnd.mobius.mbk":["mbk"],"application/vnd.mobius.mqy":["mqy"],"application/vnd.mobius.msl":["msl"],"application/vnd.mobius.plc":["plc"],"application/vnd.mobius.txf":["txf"],"application/vnd.mophun.application":["mpn"],"application/vnd.mophun.certificate":["mpc"],"application/vnd.mozilla.xul+xml":["xul"],"application/vnd.ms-artgalry":["cil"],"application/vnd.ms-cab-compressed":["cab"],"application/vnd.ms-excel":["xls","xlm","xla","xlc","xlt","xlw"],"application/vnd.ms-excel.addin.macroenabled.12":["xlam"],"application/vnd.ms-excel.sheet.binary.macroenabled.12":["xlsb"],"application/vnd.ms-excel.sheet.macroenabled.12":["xlsm"],"application/vnd.ms-excel.template.macroenabled.12":["xltm"],"application/vnd.ms-fontobject":["eot"],"application/vnd.ms-htmlhelp":["chm"],"application/vnd.ms-ims":["ims"],"application/vnd.ms-lrm":["lrm"],"application/vnd.ms-officetheme":["thmx"],"application/vnd.ms-outlook":["msg"],"application/vnd.ms-pki.seccat":["cat"],"application/vnd.ms-pki.stl":["*stl"],"application/vnd.ms-powerpoint":["ppt","pps","pot"],"application/vnd.ms-powerpoint.addin.macroenabled.12":["ppam"],"application/vnd.ms-powerpoint.presentation.macroenabled.12":["pptm"],"application/vnd.ms-powerpoint.slide.macroenabled.12":["sldm"],"application/vnd.ms-powerpoint.slideshow.macroenabled.12":["ppsm"],"application/vnd.ms-powerpoint.template.macroenabled.12":["potm"],"application/vnd.ms-project":["mpp","mpt"],"application/vnd.ms-word.document.macroenabled.12":["docm"],"application/vnd.ms-word.template.macroenabled.12":["dotm"],"application/vnd.ms-works":["wps","wks","wcm","wdb"],"application/vnd.ms-wpl":["wpl"],"application/vnd.ms-xpsdocument":["xps"],"application/vnd.mseq":["mseq"],"application/vnd.musician":["mus"],"application/vnd.muvee.style":["msty"],"application/vnd.mynfc":["taglet"],"application/vnd.neurolanguage.nlu":["nlu"],"application/vnd.nitf":["ntf","nitf"],"application/vnd.noblenet-directory":["nnd"],"application/vnd.noblenet-sealer":["nns"],"application/vnd.noblenet-web":["nnw"],"application/vnd.nokia.n-gage.ac+xml":["*ac"],"application/vnd.nokia.n-gage.data":["ngdat"],"application/vnd.nokia.n-gage.symbian.install":["n-gage"],"application/vnd.nokia.radio-preset":["rpst"],"application/vnd.nokia.radio-presets":["rpss"],"application/vnd.novadigm.edm":["edm"],"application/vnd.novadigm.edx":["edx"],"application/vnd.novadigm.ext":["ext"],"application/vnd.oasis.opendocument.chart":["odc"],"application/vnd.oasis.opendocument.chart-template":["otc"],"application/vnd.oasis.opendocument.database":["odb"],"application/vnd.oasis.opendocument.formula":["odf"],"application/vnd.oasis.opendocument.formula-template":["odft"],"application/vnd.oasis.opendocument.graphics":["odg"],"application/vnd.oasis.opendocument.graphics-template":["otg"],"application/vnd.oasis.opendocument.image":["odi"],"application/vnd.oasis.opendocument.image-template":["oti"],"application/vnd.oasis.opendocument.presentation":["odp"],"application/vnd.oasis.opendocument.presentation-template":["otp"],"application/vnd.oasis.opendocument.spreadsheet":["ods"],"application/vnd.oasis.opendocument.spreadsheet-template":["ots"],"application/vnd.oasis.opendocument.text":["odt"],"application/vnd.oasis.opendocument.text-master":["odm"],"application/vnd.oasis.opendocument.text-template":["ott"],"application/vnd.oasis.opendocument.text-web":["oth"],"application/vnd.olpc-sugar":["xo"],"application/vnd.oma.dd2+xml":["dd2"],"application/vnd.openblox.game+xml":["obgx"],"application/vnd.openofficeorg.extension":["oxt"],"application/vnd.openstreetmap.data+xml":["osm"],"application/vnd.openxmlformats-officedocument.presentationml.presentation":["pptx"],"application/vnd.openxmlformats-officedocument.presentationml.slide":["sldx"],"application/vnd.openxmlformats-officedocument.presentationml.slideshow":["ppsx"],"application/vnd.openxmlformats-officedocument.presentationml.template":["potx"],"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":["xlsx"],"application/vnd.openxmlformats-officedocument.spreadsheetml.template":["xltx"],"application/vnd.openxmlformats-officedocument.wordprocessingml.document":["docx"],"application/vnd.openxmlformats-officedocument.wordprocessingml.template":["dotx"],"application/vnd.osgeo.mapguide.package":["mgp"],"application/vnd.osgi.dp":["dp"],"application/vnd.osgi.subsystem":["esa"],"application/vnd.palm":["pdb","pqa","oprc"],"application/vnd.pawaafile":["paw"],"application/vnd.pg.format":["str"],"application/vnd.pg.osasli":["ei6"],"application/vnd.picsel":["efif"],"application/vnd.pmi.widget":["wg"],"application/vnd.pocketlearn":["plf"],"application/vnd.powerbuilder6":["pbd"],"application/vnd.previewsystems.box":["box"],"application/vnd.proteus.magazine":["mgz"],"application/vnd.publishare-delta-tree":["qps"],"application/vnd.pvi.ptid1":["ptid"],"application/vnd.quark.quarkxpress":["qxd","qxt","qwd","qwt","qxl","qxb"],"application/vnd.rar":["rar"],"application/vnd.realvnc.bed":["bed"],"application/vnd.recordare.musicxml":["mxl"],"application/vnd.recordare.musicxml+xml":["musicxml"],"application/vnd.rig.cryptonote":["cryptonote"],"application/vnd.rim.cod":["cod"],"application/vnd.rn-realmedia":["rm"],"application/vnd.rn-realmedia-vbr":["rmvb"],"application/vnd.route66.link66+xml":["link66"],"application/vnd.sailingtracker.track":["st"],"application/vnd.seemail":["see"],"application/vnd.sema":["sema"],"application/vnd.semd":["semd"],"application/vnd.semf":["semf"],"application/vnd.shana.informed.formdata":["ifm"],"application/vnd.shana.informed.formtemplate":["itp"],"application/vnd.shana.informed.interchange":["iif"],"application/vnd.shana.informed.package":["ipk"],"application/vnd.simtech-mindmapper":["twd","twds"],"application/vnd.smaf":["mmf"],"application/vnd.smart.teacher":["teacher"],"application/vnd.software602.filler.form+xml":["fo"],"application/vnd.solent.sdkm+xml":["sdkm","sdkd"],"application/vnd.spotfire.dxp":["dxp"],"application/vnd.spotfire.sfs":["sfs"],"application/vnd.stardivision.calc":["sdc"],"application/vnd.stardivision.draw":["sda"],"application/vnd.stardivision.impress":["sdd"],"application/vnd.stardivision.math":["smf"],"application/vnd.stardivision.writer":["sdw","vor"],"application/vnd.stardivision.writer-global":["sgl"],"application/vnd.stepmania.package":["smzip"],"application/vnd.stepmania.stepchart":["sm"],"application/vnd.sun.wadl+xml":["wadl"],"application/vnd.sun.xml.calc":["sxc"],"application/vnd.sun.xml.calc.template":["stc"],"application/vnd.sun.xml.draw":["sxd"],"application/vnd.sun.xml.draw.template":["std"],"application/vnd.sun.xml.impress":["sxi"],"application/vnd.sun.xml.impress.template":["sti"],"application/vnd.sun.xml.math":["sxm"],"application/vnd.sun.xml.writer":["sxw"],"application/vnd.sun.xml.writer.global":["sxg"],"application/vnd.sun.xml.writer.template":["stw"],"application/vnd.sus-calendar":["sus","susp"],"application/vnd.svd":["svd"],"application/vnd.symbian.install":["sis","sisx"],"application/vnd.syncml+xml":["xsm"],"application/vnd.syncml.dm+wbxml":["bdm"],"application/vnd.syncml.dm+xml":["xdm"],"application/vnd.syncml.dmddf+xml":["ddf"],"application/vnd.tao.intent-module-archive":["tao"],"application/vnd.tcpdump.pcap":["pcap","cap","dmp"],"application/vnd.tmobile-livetv":["tmo"],"application/vnd.trid.tpt":["tpt"],"application/vnd.triscape.mxs":["mxs"],"application/vnd.trueapp":["tra"],"application/vnd.ufdl":["ufd","ufdl"],"application/vnd.uiq.theme":["utz"],"application/vnd.umajin":["umj"],"application/vnd.unity":["unityweb"],"application/vnd.uoml+xml":["uoml"],"application/vnd.vcx":["vcx"],"application/vnd.visio":["vsd","vst","vss","vsw"],"application/vnd.visionary":["vis"],"application/vnd.vsf":["vsf"],"application/vnd.wap.wbxml":["wbxml"],"application/vnd.wap.wmlc":["wmlc"],"application/vnd.wap.wmlscriptc":["wmlsc"],"application/vnd.webturbo":["wtb"],"application/vnd.wolfram.player":["nbp"],"application/vnd.wordperfect":["wpd"],"application/vnd.wqd":["wqd"],"application/vnd.wt.stf":["stf"],"application/vnd.xara":["xar"],"application/vnd.xfdl":["xfdl"],"application/vnd.yamaha.hv-dic":["hvd"],"application/vnd.yamaha.hv-script":["hvs"],"application/vnd.yamaha.hv-voice":["hvp"],"application/vnd.yamaha.openscoreformat":["osf"],"application/vnd.yamaha.openscoreformat.osfpvg+xml":["osfpvg"],"application/vnd.yamaha.smaf-audio":["saf"],"application/vnd.yamaha.smaf-phrase":["spf"],"application/vnd.yellowriver-custom-menu":["cmp"],"application/vnd.zul":["zir","zirz"],"application/vnd.zzazz.deck+xml":["zaz"],"application/x-7z-compressed":["7z"],"application/x-abiword":["abw"],"application/x-ace-compressed":["ace"],"application/x-apple-diskimage":["*dmg"],"application/x-arj":["arj"],"application/x-authorware-bin":["aab","x32","u32","vox"],"application/x-authorware-map":["aam"],"application/x-authorware-seg":["aas"],"application/x-bcpio":["bcpio"],"application/x-bdoc":["*bdoc"],"application/x-bittorrent":["torrent"],"application/x-blorb":["blb","blorb"],"application/x-bzip":["bz"],"application/x-bzip2":["bz2","boz"],"application/x-cbr":["cbr","cba","cbt","cbz","cb7"],"application/x-cdlink":["vcd"],"application/x-cfs-compressed":["cfs"],"application/x-chat":["chat"],"application/x-chess-pgn":["pgn"],"application/x-chrome-extension":["crx"],"application/x-cocoa":["cco"],"application/x-conference":["nsc"],"application/x-cpio":["cpio"],"application/x-csh":["csh"],"application/x-debian-package":["*deb","udeb"],"application/x-dgc-compressed":["dgc"],"application/x-director":["dir","dcr","dxr","cst","cct","cxt","w3d","fgd","swa"],"application/x-doom":["wad"],"application/x-dtbncx+xml":["ncx"],"application/x-dtbook+xml":["dtb"],"application/x-dtbresource+xml":["res"],"application/x-dvi":["dvi"],"application/x-envoy":["evy"],"application/x-eva":["eva"],"application/x-font-bdf":["bdf"],"application/x-font-ghostscript":["gsf"],"application/x-font-linux-psf":["psf"],"application/x-font-pcf":["pcf"],"application/x-font-snf":["snf"],"application/x-font-type1":["pfa","pfb","pfm","afm"],"application/x-freearc":["arc"],"application/x-futuresplash":["spl"],"application/x-gca-compressed":["gca"],"application/x-glulx":["ulx"],"application/x-gnumeric":["gnumeric"],"application/x-gramps-xml":["gramps"],"application/x-gtar":["gtar"],"application/x-hdf":["hdf"],"application/x-httpd-php":["php"],"application/x-install-instructions":["install"],"application/x-iso9660-image":["*iso"],"application/x-java-archive-diff":["jardiff"],"application/x-java-jnlp-file":["jnlp"],"application/x-keepass2":["kdbx"],"application/x-latex":["latex"],"application/x-lua-bytecode":["luac"],"application/x-lzh-compressed":["lzh","lha"],"application/x-makeself":["run"],"application/x-mie":["mie"],"application/x-mobipocket-ebook":["prc","mobi"],"application/x-ms-application":["application"],"application/x-ms-shortcut":["lnk"],"application/x-ms-wmd":["wmd"],"application/x-ms-wmz":["wmz"],"application/x-ms-xbap":["xbap"],"application/x-msaccess":["mdb"],"application/x-msbinder":["obd"],"application/x-mscardfile":["crd"],"application/x-msclip":["clp"],"application/x-msdos-program":["*exe"],"application/x-msdownload":["*exe","*dll","com","bat","*msi"],"application/x-msmediaview":["mvb","m13","m14"],"application/x-msmetafile":["*wmf","*wmz","*emf","emz"],"application/x-msmoney":["mny"],"application/x-mspublisher":["pub"],"application/x-msschedule":["scd"],"application/x-msterminal":["trm"],"application/x-mswrite":["wri"],"application/x-netcdf":["nc","cdf"],"application/x-ns-proxy-autoconfig":["pac"],"application/x-nzb":["nzb"],"application/x-perl":["pl","pm"],"application/x-pilot":["*prc","*pdb"],"application/x-pkcs12":["p12","pfx"],"application/x-pkcs7-certificates":["p7b","spc"],"application/x-pkcs7-certreqresp":["p7r"],"application/x-rar-compressed":["*rar"],"application/x-redhat-package-manager":["rpm"],"application/x-research-info-systems":["ris"],"application/x-sea":["sea"],"application/x-sh":["sh"],"application/x-shar":["shar"],"application/x-shockwave-flash":["swf"],"application/x-silverlight-app":["xap"],"application/x-sql":["sql"],"application/x-stuffit":["sit"],"application/x-stuffitx":["sitx"],"application/x-subrip":["srt"],"application/x-sv4cpio":["sv4cpio"],"application/x-sv4crc":["sv4crc"],"application/x-t3vm-image":["t3"],"application/x-tads":["gam"],"application/x-tar":["tar"],"application/x-tcl":["tcl","tk"],"application/x-tex":["tex"],"application/x-tex-tfm":["tfm"],"application/x-texinfo":["texinfo","texi"],"application/x-tgif":["*obj"],"application/x-ustar":["ustar"],"application/x-virtualbox-hdd":["hdd"],"application/x-virtualbox-ova":["ova"],"application/x-virtualbox-ovf":["ovf"],"application/x-virtualbox-vbox":["vbox"],"application/x-virtualbox-vbox-extpack":["vbox-extpack"],"application/x-virtualbox-vdi":["vdi"],"application/x-virtualbox-vhd":["vhd"],"application/x-virtualbox-vmdk":["vmdk"],"application/x-wais-source":["src"],"application/x-web-app-manifest+json":["webapp"],"application/x-x509-ca-cert":["der","crt","pem"],"application/x-xfig":["fig"],"application/x-xliff+xml":["*xlf"],"application/x-xpinstall":["xpi"],"application/x-xz":["xz"],"application/x-zmachine":["z1","z2","z3","z4","z5","z6","z7","z8"],"audio/vnd.dece.audio":["uva","uvva"],"audio/vnd.digital-winds":["eol"],"audio/vnd.dra":["dra"],"audio/vnd.dts":["dts"],"audio/vnd.dts.hd":["dtshd"],"audio/vnd.lucent.voice":["lvp"],"audio/vnd.ms-playready.media.pya":["pya"],"audio/vnd.nuera.ecelp4800":["ecelp4800"],"audio/vnd.nuera.ecelp7470":["ecelp7470"],"audio/vnd.nuera.ecelp9600":["ecelp9600"],"audio/vnd.rip":["rip"],"audio/x-aac":["aac"],"audio/x-aiff":["aif","aiff","aifc"],"audio/x-caf":["caf"],"audio/x-flac":["flac"],"audio/x-m4a":["*m4a"],"audio/x-matroska":["mka"],"audio/x-mpegurl":["m3u"],"audio/x-ms-wax":["wax"],"audio/x-ms-wma":["wma"],"audio/x-pn-realaudio":["ram","ra"],"audio/x-pn-realaudio-plugin":["rmp"],"audio/x-realaudio":["*ra"],"audio/x-wav":["*wav"],"chemical/x-cdx":["cdx"],"chemical/x-cif":["cif"],"chemical/x-cmdf":["cmdf"],"chemical/x-cml":["cml"],"chemical/x-csml":["csml"],"chemical/x-xyz":["xyz"],"image/prs.btif":["btif"],"image/prs.pti":["pti"],"image/vnd.adobe.photoshop":["psd"],"image/vnd.airzip.accelerator.azv":["azv"],"image/vnd.dece.graphic":["uvi","uvvi","uvg","uvvg"],"image/vnd.djvu":["djvu","djv"],"image/vnd.dvb.subtitle":["*sub"],"image/vnd.dwg":["dwg"],"image/vnd.dxf":["dxf"],"image/vnd.fastbidsheet":["fbs"],"image/vnd.fpx":["fpx"],"image/vnd.fst":["fst"],"image/vnd.fujixerox.edmics-mmr":["mmr"],"image/vnd.fujixerox.edmics-rlc":["rlc"],"image/vnd.microsoft.icon":["ico"],"image/vnd.ms-dds":["dds"],"image/vnd.ms-modi":["mdi"],"image/vnd.ms-photo":["wdp"],"image/vnd.net-fpx":["npx"],"image/vnd.pco.b16":["b16"],"image/vnd.tencent.tap":["tap"],"image/vnd.valve.source.texture":["vtf"],"image/vnd.wap.wbmp":["wbmp"],"image/vnd.xiff":["xif"],"image/vnd.zbrush.pcx":["pcx"],"image/x-3ds":["3ds"],"image/x-cmu-raster":["ras"],"image/x-cmx":["cmx"],"image/x-freehand":["fh","fhc","fh4","fh5","fh7"],"image/x-icon":["*ico"],"image/x-jng":["jng"],"image/x-mrsid-image":["sid"],"image/x-ms-bmp":["*bmp"],"image/x-pcx":["*pcx"],"image/x-pict":["pic","pct"],"image/x-portable-anymap":["pnm"],"image/x-portable-bitmap":["pbm"],"image/x-portable-graymap":["pgm"],"image/x-portable-pixmap":["ppm"],"image/x-rgb":["rgb"],"image/x-tga":["tga"],"image/x-xbitmap":["xbm"],"image/x-xpixmap":["xpm"],"image/x-xwindowdump":["xwd"],"message/vnd.wfa.wsc":["wsc"],"model/vnd.collada+xml":["dae"],"model/vnd.dwf":["dwf"],"model/vnd.gdl":["gdl"],"model/vnd.gtw":["gtw"],"model/vnd.mts":["mts"],"model/vnd.opengex":["ogex"],"model/vnd.parasolid.transmit.binary":["x_b"],"model/vnd.parasolid.transmit.text":["x_t"],"model/vnd.usdz+zip":["usdz"],"model/vnd.valve.source.compiled-map":["bsp"],"model/vnd.vtu":["vtu"],"text/prs.lines.tag":["dsc"],"text/vnd.curl":["curl"],"text/vnd.curl.dcurl":["dcurl"],"text/vnd.curl.mcurl":["mcurl"],"text/vnd.curl.scurl":["scurl"],"text/vnd.dvb.subtitle":["sub"],"text/vnd.fly":["fly"],"text/vnd.fmi.flexstor":["flx"],"text/vnd.graphviz":["gv"],"text/vnd.in3d.3dml":["3dml"],"text/vnd.in3d.spot":["spot"],"text/vnd.sun.j2me.app-descriptor":["jad"],"text/vnd.wap.wml":["wml"],"text/vnd.wap.wmlscript":["wmls"],"text/x-asm":["s","asm"],"text/x-c":["c","cc","cxx","cpp","h","hh","dic"],"text/x-component":["htc"],"text/x-fortran":["f","for","f77","f90"],"text/x-handlebars-template":["hbs"],"text/x-java-source":["java"],"text/x-lua":["lua"],"text/x-markdown":["mkd"],"text/x-nfo":["nfo"],"text/x-opml":["opml"],"text/x-org":["*org"],"text/x-pascal":["p","pas"],"text/x-processing":["pde"],"text/x-sass":["sass"],"text/x-scss":["scss"],"text/x-setext":["etx"],"text/x-sfv":["sfv"],"text/x-suse-ymp":["ymp"],"text/x-uuencode":["uu"],"text/x-vcalendar":["vcs"],"text/x-vcard":["vcf"],"video/vnd.dece.hd":["uvh","uvvh"],"video/vnd.dece.mobile":["uvm","uvvm"],"video/vnd.dece.pd":["uvp","uvvp"],"video/vnd.dece.sd":["uvs","uvvs"],"video/vnd.dece.video":["uvv","uvvv"],"video/vnd.dvb.file":["dvb"],"video/vnd.fvt":["fvt"],"video/vnd.mpegurl":["mxu","m4u"],"video/vnd.ms-playready.media.pyv":["pyv"],"video/vnd.uvvu.mp4":["uvu","uvvu"],"video/vnd.vivo":["viv"],"video/x-f4v":["f4v"],"video/x-fli":["fli"],"video/x-flv":["flv"],"video/x-m4v":["m4v"],"video/x-matroska":["mkv","mk3d","mks"],"video/x-mng":["mng"],"video/x-ms-asf":["asf","asx"],"video/x-ms-vob":["vob"],"video/x-ms-wm":["wm"],"video/x-ms-wmv":["wmv"],"video/x-ms-wmx":["wmx"],"video/x-ms-wvx":["wvx"],"video/x-msvideo":["avi"],"video/x-sgi-movie":["movie"],"video/x-smv":["smv"],"x-conference/x-cooltalk":["ice"]}; +},{}],284:[function(require,module,exports){ +module.exports = {"application/andrew-inset":["ez"],"application/applixware":["aw"],"application/atom+xml":["atom"],"application/atomcat+xml":["atomcat"],"application/atomdeleted+xml":["atomdeleted"],"application/atomsvc+xml":["atomsvc"],"application/atsc-dwd+xml":["dwd"],"application/atsc-held+xml":["held"],"application/atsc-rsat+xml":["rsat"],"application/bdoc":["bdoc"],"application/calendar+xml":["xcs"],"application/ccxml+xml":["ccxml"],"application/cdfx+xml":["cdfx"],"application/cdmi-capability":["cdmia"],"application/cdmi-container":["cdmic"],"application/cdmi-domain":["cdmid"],"application/cdmi-object":["cdmio"],"application/cdmi-queue":["cdmiq"],"application/cu-seeme":["cu"],"application/dash+xml":["mpd"],"application/davmount+xml":["davmount"],"application/docbook+xml":["dbk"],"application/dssc+der":["dssc"],"application/dssc+xml":["xdssc"],"application/ecmascript":["ecma","es"],"application/emma+xml":["emma"],"application/emotionml+xml":["emotionml"],"application/epub+zip":["epub"],"application/exi":["exi"],"application/fdt+xml":["fdt"],"application/font-tdpfr":["pfr"],"application/geo+json":["geojson"],"application/gml+xml":["gml"],"application/gpx+xml":["gpx"],"application/gxf":["gxf"],"application/gzip":["gz"],"application/hjson":["hjson"],"application/hyperstudio":["stk"],"application/inkml+xml":["ink","inkml"],"application/ipfix":["ipfix"],"application/its+xml":["its"],"application/java-archive":["jar","war","ear"],"application/java-serialized-object":["ser"],"application/java-vm":["class"],"application/javascript":["js","mjs"],"application/json":["json","map"],"application/json5":["json5"],"application/jsonml+json":["jsonml"],"application/ld+json":["jsonld"],"application/lgr+xml":["lgr"],"application/lost+xml":["lostxml"],"application/mac-binhex40":["hqx"],"application/mac-compactpro":["cpt"],"application/mads+xml":["mads"],"application/manifest+json":["webmanifest"],"application/marc":["mrc"],"application/marcxml+xml":["mrcx"],"application/mathematica":["ma","nb","mb"],"application/mathml+xml":["mathml"],"application/mbox":["mbox"],"application/mediaservercontrol+xml":["mscml"],"application/metalink+xml":["metalink"],"application/metalink4+xml":["meta4"],"application/mets+xml":["mets"],"application/mmt-aei+xml":["maei"],"application/mmt-usd+xml":["musd"],"application/mods+xml":["mods"],"application/mp21":["m21","mp21"],"application/mp4":["mp4s","m4p"],"application/mrb-consumer+xml":["*xdf"],"application/mrb-publish+xml":["*xdf"],"application/msword":["doc","dot"],"application/mxf":["mxf"],"application/n-quads":["nq"],"application/n-triples":["nt"],"application/node":["cjs"],"application/octet-stream":["bin","dms","lrf","mar","so","dist","distz","pkg","bpk","dump","elc","deploy","exe","dll","deb","dmg","iso","img","msi","msp","msm","buffer"],"application/oda":["oda"],"application/oebps-package+xml":["opf"],"application/ogg":["ogx"],"application/omdoc+xml":["omdoc"],"application/onenote":["onetoc","onetoc2","onetmp","onepkg"],"application/oxps":["oxps"],"application/p2p-overlay+xml":["relo"],"application/patch-ops-error+xml":["*xer"],"application/pdf":["pdf"],"application/pgp-encrypted":["pgp"],"application/pgp-signature":["asc","sig"],"application/pics-rules":["prf"],"application/pkcs10":["p10"],"application/pkcs7-mime":["p7m","p7c"],"application/pkcs7-signature":["p7s"],"application/pkcs8":["p8"],"application/pkix-attr-cert":["ac"],"application/pkix-cert":["cer"],"application/pkix-crl":["crl"],"application/pkix-pkipath":["pkipath"],"application/pkixcmp":["pki"],"application/pls+xml":["pls"],"application/postscript":["ai","eps","ps"],"application/provenance+xml":["provx"],"application/pskc+xml":["pskcxml"],"application/raml+yaml":["raml"],"application/rdf+xml":["rdf","owl"],"application/reginfo+xml":["rif"],"application/relax-ng-compact-syntax":["rnc"],"application/resource-lists+xml":["rl"],"application/resource-lists-diff+xml":["rld"],"application/rls-services+xml":["rs"],"application/route-apd+xml":["rapd"],"application/route-s-tsid+xml":["sls"],"application/route-usd+xml":["rusd"],"application/rpki-ghostbusters":["gbr"],"application/rpki-manifest":["mft"],"application/rpki-roa":["roa"],"application/rsd+xml":["rsd"],"application/rss+xml":["rss"],"application/rtf":["rtf"],"application/sbml+xml":["sbml"],"application/scvp-cv-request":["scq"],"application/scvp-cv-response":["scs"],"application/scvp-vp-request":["spq"],"application/scvp-vp-response":["spp"],"application/sdp":["sdp"],"application/senml+xml":["senmlx"],"application/sensml+xml":["sensmlx"],"application/set-payment-initiation":["setpay"],"application/set-registration-initiation":["setreg"],"application/shf+xml":["shf"],"application/sieve":["siv","sieve"],"application/smil+xml":["smi","smil"],"application/sparql-query":["rq"],"application/sparql-results+xml":["srx"],"application/srgs":["gram"],"application/srgs+xml":["grxml"],"application/sru+xml":["sru"],"application/ssdl+xml":["ssdl"],"application/ssml+xml":["ssml"],"application/swid+xml":["swidtag"],"application/tei+xml":["tei","teicorpus"],"application/thraud+xml":["tfi"],"application/timestamped-data":["tsd"],"application/toml":["toml"],"application/ttml+xml":["ttml"],"application/ubjson":["ubj"],"application/urc-ressheet+xml":["rsheet"],"application/urc-targetdesc+xml":["td"],"application/voicexml+xml":["vxml"],"application/wasm":["wasm"],"application/widget":["wgt"],"application/winhlp":["hlp"],"application/wsdl+xml":["wsdl"],"application/wspolicy+xml":["wspolicy"],"application/xaml+xml":["xaml"],"application/xcap-att+xml":["xav"],"application/xcap-caps+xml":["xca"],"application/xcap-diff+xml":["xdf"],"application/xcap-el+xml":["xel"],"application/xcap-error+xml":["xer"],"application/xcap-ns+xml":["xns"],"application/xenc+xml":["xenc"],"application/xhtml+xml":["xhtml","xht"],"application/xliff+xml":["xlf"],"application/xml":["xml","xsl","xsd","rng"],"application/xml-dtd":["dtd"],"application/xop+xml":["xop"],"application/xproc+xml":["xpl"],"application/xslt+xml":["*xsl","xslt"],"application/xspf+xml":["xspf"],"application/xv+xml":["mxml","xhvml","xvml","xvm"],"application/yang":["yang"],"application/yin+xml":["yin"],"application/zip":["zip"],"audio/3gpp":["*3gpp"],"audio/adpcm":["adp"],"audio/amr":["amr"],"audio/basic":["au","snd"],"audio/midi":["mid","midi","kar","rmi"],"audio/mobile-xmf":["mxmf"],"audio/mp3":["*mp3"],"audio/mp4":["m4a","mp4a"],"audio/mpeg":["mpga","mp2","mp2a","mp3","m2a","m3a"],"audio/ogg":["oga","ogg","spx","opus"],"audio/s3m":["s3m"],"audio/silk":["sil"],"audio/wav":["wav"],"audio/wave":["*wav"],"audio/webm":["weba"],"audio/xm":["xm"],"font/collection":["ttc"],"font/otf":["otf"],"font/ttf":["ttf"],"font/woff":["woff"],"font/woff2":["woff2"],"image/aces":["exr"],"image/apng":["apng"],"image/avif":["avif"],"image/bmp":["bmp"],"image/cgm":["cgm"],"image/dicom-rle":["drle"],"image/emf":["emf"],"image/fits":["fits"],"image/g3fax":["g3"],"image/gif":["gif"],"image/heic":["heic"],"image/heic-sequence":["heics"],"image/heif":["heif"],"image/heif-sequence":["heifs"],"image/hej2k":["hej2"],"image/hsj2":["hsj2"],"image/ief":["ief"],"image/jls":["jls"],"image/jp2":["jp2","jpg2"],"image/jpeg":["jpeg","jpg","jpe"],"image/jph":["jph"],"image/jphc":["jhc"],"image/jpm":["jpm"],"image/jpx":["jpx","jpf"],"image/jxr":["jxr"],"image/jxra":["jxra"],"image/jxrs":["jxrs"],"image/jxs":["jxs"],"image/jxsc":["jxsc"],"image/jxsi":["jxsi"],"image/jxss":["jxss"],"image/ktx":["ktx"],"image/ktx2":["ktx2"],"image/png":["png"],"image/sgi":["sgi"],"image/svg+xml":["svg","svgz"],"image/t38":["t38"],"image/tiff":["tif","tiff"],"image/tiff-fx":["tfx"],"image/webp":["webp"],"image/wmf":["wmf"],"message/disposition-notification":["disposition-notification"],"message/global":["u8msg"],"message/global-delivery-status":["u8dsn"],"message/global-disposition-notification":["u8mdn"],"message/global-headers":["u8hdr"],"message/rfc822":["eml","mime"],"model/3mf":["3mf"],"model/gltf+json":["gltf"],"model/gltf-binary":["glb"],"model/iges":["igs","iges"],"model/mesh":["msh","mesh","silo"],"model/mtl":["mtl"],"model/obj":["obj"],"model/stl":["stl"],"model/vrml":["wrl","vrml"],"model/x3d+binary":["*x3db","x3dbz"],"model/x3d+fastinfoset":["x3db"],"model/x3d+vrml":["*x3dv","x3dvz"],"model/x3d+xml":["x3d","x3dz"],"model/x3d-vrml":["x3dv"],"text/cache-manifest":["appcache","manifest"],"text/calendar":["ics","ifb"],"text/coffeescript":["coffee","litcoffee"],"text/css":["css"],"text/csv":["csv"],"text/html":["html","htm","shtml"],"text/jade":["jade"],"text/jsx":["jsx"],"text/less":["less"],"text/markdown":["markdown","md"],"text/mathml":["mml"],"text/mdx":["mdx"],"text/n3":["n3"],"text/plain":["txt","text","conf","def","list","log","in","ini"],"text/richtext":["rtx"],"text/rtf":["*rtf"],"text/sgml":["sgml","sgm"],"text/shex":["shex"],"text/slim":["slim","slm"],"text/spdx":["spdx"],"text/stylus":["stylus","styl"],"text/tab-separated-values":["tsv"],"text/troff":["t","tr","roff","man","me","ms"],"text/turtle":["ttl"],"text/uri-list":["uri","uris","urls"],"text/vcard":["vcard"],"text/vtt":["vtt"],"text/xml":["*xml"],"text/yaml":["yaml","yml"],"video/3gpp":["3gp","3gpp"],"video/3gpp2":["3g2"],"video/h261":["h261"],"video/h263":["h263"],"video/h264":["h264"],"video/iso.segment":["m4s"],"video/jpeg":["jpgv"],"video/jpm":["*jpm","jpgm"],"video/mj2":["mj2","mjp2"],"video/mp2t":["ts"],"video/mp4":["mp4","mp4v","mpg4"],"video/mpeg":["mpeg","mpg","mpe","m1v","m2v"],"video/ogg":["ogv"],"video/quicktime":["qt","mov"],"video/webm":["webm"]}; +},{}],285:[function(require,module,exports){ module.exports = assert; function assert(val, msg) { @@ -41517,7 +41803,7 @@ assert.equal = function assertEqual(l, r, msg) { throw new Error(msg || ('Assertion failed: ' + l + ' != ' + r)); }; -},{}],288:[function(require,module,exports){ +},{}],286:[function(require,module,exports){ 'use strict'; var utils = exports; @@ -41577,7 +41863,7 @@ utils.encode = function encode(arr, enc) { return arr; }; -},{}],289:[function(require,module,exports){ +},{}],287:[function(require,module,exports){ (function (Buffer){(function (){ // This is an intentionally recursive require. I don't like it either. var Box = require('./index') @@ -42589,7 +42875,7 @@ function readString (buf, offset, length) { } }).call(this)}).call(this,require("buffer").Buffer) -},{"./descriptor":290,"./index":291,"buffer":116,"uint64be":492}],290:[function(require,module,exports){ +},{"./descriptor":288,"./index":289,"buffer":110,"uint64be":480}],288:[function(require,module,exports){ (function (Buffer){(function (){ var tagToName = { 0x03: 'ESDescriptor', @@ -42665,7 +42951,7 @@ exports.DecoderConfigDescriptor.decode = function (buf, start, end) { } }).call(this)}).call(this,require("buffer").Buffer) -},{"buffer":116}],291:[function(require,module,exports){ +},{"buffer":110}],289:[function(require,module,exports){ (function (Buffer){(function (){ // var assert = require('assert') var uint64be = require('uint64be') @@ -42894,7 +43180,7 @@ Box.encodingLength = function (obj) { } }).call(this)}).call(this,require("buffer").Buffer) -},{"./boxes":289,"buffer":116,"uint64be":492}],292:[function(require,module,exports){ +},{"./boxes":287,"buffer":110,"uint64be":480}],290:[function(require,module,exports){ (function (Buffer){(function (){ var stream = require('readable-stream') var nextEvent = require('next-event') @@ -43084,7 +43370,7 @@ class MediaData extends stream.PassThrough { module.exports = Decoder }).call(this)}).call(this,require("buffer").Buffer) -},{"buffer":116,"mp4-box-encoding":291,"next-event":326,"readable-stream":309}],293:[function(require,module,exports){ +},{"buffer":110,"mp4-box-encoding":289,"next-event":325,"readable-stream":307}],291:[function(require,module,exports){ (function (Buffer){(function (){ var stream = require('readable-stream') var Box = require('mp4-box-encoding') @@ -43223,44 +43509,208 @@ class MediaData extends stream.PassThrough { module.exports = Encoder }).call(this)}).call(this,require("buffer").Buffer) -},{"buffer":116,"mp4-box-encoding":291,"queue-microtask":355,"readable-stream":309}],294:[function(require,module,exports){ +},{"buffer":110,"mp4-box-encoding":289,"queue-microtask":354,"readable-stream":307}],292:[function(require,module,exports){ const Decoder = require('./decode') const Encoder = require('./encode') exports.decode = opts => new Decoder(opts) exports.encode = opts => new Encoder(opts) -},{"./decode":292,"./encode":293}],295:[function(require,module,exports){ +},{"./decode":290,"./encode":291}],293:[function(require,module,exports){ +arguments[4][29][0].apply(exports,arguments) +},{"dup":29}],294:[function(require,module,exports){ +arguments[4][30][0].apply(exports,arguments) +},{"./_stream_readable":296,"./_stream_writable":298,"_process":341,"dup":30,"inherits":246}],295:[function(require,module,exports){ +arguments[4][31][0].apply(exports,arguments) +},{"./_stream_transform":297,"dup":31,"inherits":246}],296:[function(require,module,exports){ arguments[4][32][0].apply(exports,arguments) -},{"dup":32}],296:[function(require,module,exports){ +},{"../errors":293,"./_stream_duplex":294,"./internal/streams/async_iterator":299,"./internal/streams/buffer_list":300,"./internal/streams/destroy":301,"./internal/streams/from":303,"./internal/streams/state":305,"./internal/streams/stream":306,"_process":341,"buffer":110,"dup":32,"events":193,"inherits":246,"string_decoder/":472,"util":67}],297:[function(require,module,exports){ arguments[4][33][0].apply(exports,arguments) -},{"./_stream_readable":298,"./_stream_writable":300,"_process":342,"dup":33,"inherits":249}],297:[function(require,module,exports){ +},{"../errors":293,"./_stream_duplex":294,"dup":33,"inherits":246}],298:[function(require,module,exports){ arguments[4][34][0].apply(exports,arguments) -},{"./_stream_transform":299,"dup":34,"inherits":249}],298:[function(require,module,exports){ +},{"../errors":293,"./_stream_duplex":294,"./internal/streams/destroy":301,"./internal/streams/state":305,"./internal/streams/stream":306,"_process":341,"buffer":110,"dup":34,"inherits":246,"util-deprecate":485}],299:[function(require,module,exports){ arguments[4][35][0].apply(exports,arguments) -},{"../errors":295,"./_stream_duplex":296,"./internal/streams/async_iterator":301,"./internal/streams/buffer_list":302,"./internal/streams/destroy":303,"./internal/streams/from":305,"./internal/streams/state":307,"./internal/streams/stream":308,"_process":342,"buffer":116,"dup":35,"events":196,"inherits":249,"string_decoder/":481,"util":73}],299:[function(require,module,exports){ +},{"./end-of-stream":302,"_process":341,"dup":35}],300:[function(require,module,exports){ arguments[4][36][0].apply(exports,arguments) -},{"../errors":295,"./_stream_duplex":296,"dup":36,"inherits":249}],300:[function(require,module,exports){ +},{"buffer":110,"dup":36,"util":67}],301:[function(require,module,exports){ arguments[4][37][0].apply(exports,arguments) -},{"../errors":295,"./_stream_duplex":296,"./internal/streams/destroy":303,"./internal/streams/state":307,"./internal/streams/stream":308,"_process":342,"buffer":116,"dup":37,"inherits":249,"util-deprecate":500}],301:[function(require,module,exports){ +},{"_process":341,"dup":37}],302:[function(require,module,exports){ arguments[4][38][0].apply(exports,arguments) -},{"./end-of-stream":304,"_process":342,"dup":38}],302:[function(require,module,exports){ +},{"../../../errors":293,"dup":38}],303:[function(require,module,exports){ arguments[4][39][0].apply(exports,arguments) -},{"buffer":116,"dup":39,"util":73}],303:[function(require,module,exports){ +},{"dup":39}],304:[function(require,module,exports){ arguments[4][40][0].apply(exports,arguments) -},{"_process":342,"dup":40}],304:[function(require,module,exports){ +},{"../../../errors":293,"./end-of-stream":302,"dup":40}],305:[function(require,module,exports){ arguments[4][41][0].apply(exports,arguments) -},{"../../../errors":295,"dup":41}],305:[function(require,module,exports){ +},{"../../../errors":293,"dup":41}],306:[function(require,module,exports){ arguments[4][42][0].apply(exports,arguments) -},{"dup":42}],306:[function(require,module,exports){ +},{"dup":42,"events":193}],307:[function(require,module,exports){ arguments[4][43][0].apply(exports,arguments) -},{"../../../errors":295,"./end-of-stream":304,"dup":43}],307:[function(require,module,exports){ -arguments[4][44][0].apply(exports,arguments) -},{"../../../errors":295,"dup":44}],308:[function(require,module,exports){ -arguments[4][45][0].apply(exports,arguments) -},{"dup":45,"events":196}],309:[function(require,module,exports){ -arguments[4][46][0].apply(exports,arguments) -},{"./lib/_stream_duplex.js":296,"./lib/_stream_passthrough.js":297,"./lib/_stream_readable.js":298,"./lib/_stream_transform.js":299,"./lib/_stream_writable.js":300,"./lib/internal/streams/end-of-stream.js":304,"./lib/internal/streams/pipeline.js":306,"dup":46}],310:[function(require,module,exports){ +},{"./lib/_stream_duplex.js":294,"./lib/_stream_passthrough.js":295,"./lib/_stream_readable.js":296,"./lib/_stream_transform.js":297,"./lib/_stream_writable.js":298,"./lib/internal/streams/end-of-stream.js":302,"./lib/internal/streams/pipeline.js":304,"dup":43}],308:[function(require,module,exports){ +/** + * Helpers. + */ + +var s = 1000; +var m = s * 60; +var h = m * 60; +var d = h * 24; +var w = d * 7; +var y = d * 365.25; + +/** + * Parse or format the given `val`. + * + * Options: + * + * - `long` verbose formatting [false] + * + * @param {String|Number} val + * @param {Object} [options] + * @throws {Error} throw an error if val is not a non-empty string or a number + * @return {String|Number} + * @api public + */ + +module.exports = function(val, options) { + options = options || {}; + var type = typeof val; + if (type === 'string' && val.length > 0) { + return parse(val); + } else if (type === 'number' && isFinite(val)) { + return options.long ? fmtLong(val) : fmtShort(val); + } + throw new Error( + 'val is not a non-empty string or a valid number. val=' + + JSON.stringify(val) + ); +}; + +/** + * Parse the given `str` and return milliseconds. + * + * @param {String} str + * @return {Number} + * @api private + */ + +function parse(str) { + str = String(str); + if (str.length > 100) { + return; + } + var match = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec( + str + ); + if (!match) { + return; + } + var n = parseFloat(match[1]); + var type = (match[2] || 'ms').toLowerCase(); + switch (type) { + case 'years': + case 'year': + case 'yrs': + case 'yr': + case 'y': + return n * y; + case 'weeks': + case 'week': + case 'w': + return n * w; + case 'days': + case 'day': + case 'd': + return n * d; + case 'hours': + case 'hour': + case 'hrs': + case 'hr': + case 'h': + return n * h; + case 'minutes': + case 'minute': + case 'mins': + case 'min': + case 'm': + return n * m; + case 'seconds': + case 'second': + case 'secs': + case 'sec': + case 's': + return n * s; + case 'milliseconds': + case 'millisecond': + case 'msecs': + case 'msec': + case 'ms': + return n; + default: + return undefined; + } +} + +/** + * Short format for `ms`. + * + * @param {Number} ms + * @return {String} + * @api private + */ + +function fmtShort(ms) { + var msAbs = Math.abs(ms); + if (msAbs >= d) { + return Math.round(ms / d) + 'd'; + } + if (msAbs >= h) { + return Math.round(ms / h) + 'h'; + } + if (msAbs >= m) { + return Math.round(ms / m) + 'm'; + } + if (msAbs >= s) { + return Math.round(ms / s) + 's'; + } + return ms + 'ms'; +} + +/** + * Long format for `ms`. + * + * @param {Number} ms + * @return {String} + * @api private + */ + +function fmtLong(ms) { + var msAbs = Math.abs(ms); + if (msAbs >= d) { + return plural(ms, msAbs, d, 'day'); + } + if (msAbs >= h) { + return plural(ms, msAbs, h, 'hour'); + } + if (msAbs >= m) { + return plural(ms, msAbs, m, 'minute'); + } + if (msAbs >= s) { + return plural(ms, msAbs, s, 'second'); + } + return ms + ' ms'; +} + +/** + * Pluralization helper. + */ + +function plural(ms, msAbs, n, name) { + var isPlural = msAbs >= n * 1.5; + return Math.round(ms / n) + ' ' + name + (isPlural ? 's' : ''); +} + +},{}],309:[function(require,module,exports){ /*! multistream. MIT License. Feross Aboukhadijeh */ const stream = require('readable-stream') const once = require('once') @@ -43428,37 +43878,37 @@ function destroy (stream, err, cb) { } } -},{"once":327,"readable-stream":325}],311:[function(require,module,exports){ +},{"once":326,"readable-stream":324}],310:[function(require,module,exports){ +arguments[4][29][0].apply(exports,arguments) +},{"dup":29}],311:[function(require,module,exports){ +arguments[4][30][0].apply(exports,arguments) +},{"./_stream_readable":313,"./_stream_writable":315,"_process":341,"dup":30,"inherits":246}],312:[function(require,module,exports){ +arguments[4][31][0].apply(exports,arguments) +},{"./_stream_transform":314,"dup":31,"inherits":246}],313:[function(require,module,exports){ arguments[4][32][0].apply(exports,arguments) -},{"dup":32}],312:[function(require,module,exports){ +},{"../errors":310,"./_stream_duplex":311,"./internal/streams/async_iterator":316,"./internal/streams/buffer_list":317,"./internal/streams/destroy":318,"./internal/streams/from":320,"./internal/streams/state":322,"./internal/streams/stream":323,"_process":341,"buffer":110,"dup":32,"events":193,"inherits":246,"string_decoder/":472,"util":67}],314:[function(require,module,exports){ arguments[4][33][0].apply(exports,arguments) -},{"./_stream_readable":314,"./_stream_writable":316,"_process":342,"dup":33,"inherits":249}],313:[function(require,module,exports){ +},{"../errors":310,"./_stream_duplex":311,"dup":33,"inherits":246}],315:[function(require,module,exports){ arguments[4][34][0].apply(exports,arguments) -},{"./_stream_transform":315,"dup":34,"inherits":249}],314:[function(require,module,exports){ +},{"../errors":310,"./_stream_duplex":311,"./internal/streams/destroy":318,"./internal/streams/state":322,"./internal/streams/stream":323,"_process":341,"buffer":110,"dup":34,"inherits":246,"util-deprecate":485}],316:[function(require,module,exports){ arguments[4][35][0].apply(exports,arguments) -},{"../errors":311,"./_stream_duplex":312,"./internal/streams/async_iterator":317,"./internal/streams/buffer_list":318,"./internal/streams/destroy":319,"./internal/streams/from":321,"./internal/streams/state":323,"./internal/streams/stream":324,"_process":342,"buffer":116,"dup":35,"events":196,"inherits":249,"string_decoder/":481,"util":73}],315:[function(require,module,exports){ +},{"./end-of-stream":319,"_process":341,"dup":35}],317:[function(require,module,exports){ arguments[4][36][0].apply(exports,arguments) -},{"../errors":311,"./_stream_duplex":312,"dup":36,"inherits":249}],316:[function(require,module,exports){ +},{"buffer":110,"dup":36,"util":67}],318:[function(require,module,exports){ arguments[4][37][0].apply(exports,arguments) -},{"../errors":311,"./_stream_duplex":312,"./internal/streams/destroy":319,"./internal/streams/state":323,"./internal/streams/stream":324,"_process":342,"buffer":116,"dup":37,"inherits":249,"util-deprecate":500}],317:[function(require,module,exports){ +},{"_process":341,"dup":37}],319:[function(require,module,exports){ arguments[4][38][0].apply(exports,arguments) -},{"./end-of-stream":320,"_process":342,"dup":38}],318:[function(require,module,exports){ +},{"../../../errors":310,"dup":38}],320:[function(require,module,exports){ arguments[4][39][0].apply(exports,arguments) -},{"buffer":116,"dup":39,"util":73}],319:[function(require,module,exports){ +},{"dup":39}],321:[function(require,module,exports){ arguments[4][40][0].apply(exports,arguments) -},{"_process":342,"dup":40}],320:[function(require,module,exports){ +},{"../../../errors":310,"./end-of-stream":319,"dup":40}],322:[function(require,module,exports){ arguments[4][41][0].apply(exports,arguments) -},{"../../../errors":311,"dup":41}],321:[function(require,module,exports){ +},{"../../../errors":310,"dup":41}],323:[function(require,module,exports){ arguments[4][42][0].apply(exports,arguments) -},{"dup":42}],322:[function(require,module,exports){ +},{"dup":42,"events":193}],324:[function(require,module,exports){ arguments[4][43][0].apply(exports,arguments) -},{"../../../errors":311,"./end-of-stream":320,"dup":43}],323:[function(require,module,exports){ -arguments[4][44][0].apply(exports,arguments) -},{"../../../errors":311,"dup":44}],324:[function(require,module,exports){ -arguments[4][45][0].apply(exports,arguments) -},{"dup":45,"events":196}],325:[function(require,module,exports){ -arguments[4][46][0].apply(exports,arguments) -},{"./lib/_stream_duplex.js":312,"./lib/_stream_passthrough.js":313,"./lib/_stream_readable.js":314,"./lib/_stream_transform.js":315,"./lib/_stream_writable.js":316,"./lib/internal/streams/end-of-stream.js":320,"./lib/internal/streams/pipeline.js":322,"dup":46}],326:[function(require,module,exports){ +},{"./lib/_stream_duplex.js":311,"./lib/_stream_passthrough.js":312,"./lib/_stream_readable.js":313,"./lib/_stream_transform.js":314,"./lib/_stream_writable.js":315,"./lib/internal/streams/end-of-stream.js":319,"./lib/internal/streams/pipeline.js":321,"dup":43}],325:[function(require,module,exports){ module.exports = nextEvent function nextEvent (emitter, name) { @@ -43475,7 +43925,7 @@ function nextEvent (emitter, name) { } } -},{}],327:[function(require,module,exports){ +},{}],326:[function(require,module,exports){ var wrappy = require('wrappy') module.exports = wrappy(once) module.exports.strict = wrappy(onceStrict) @@ -43519,7 +43969,7 @@ function onceStrict (fn) { return f } -},{"wrappy":529}],328:[function(require,module,exports){ +},{"wrappy":496}],327:[function(require,module,exports){ 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", @@ -43533,7 +43983,7 @@ module.exports={"2.16.840.1.101.3.4.1.1": "aes-128-ecb", "2.16.840.1.101.3.4.1.43": "aes-256-ofb", "2.16.840.1.101.3.4.1.44": "aes-256-cfb" } -},{}],329:[function(require,module,exports){ +},{}],328:[function(require,module,exports){ // from https://github.com/indutny/self-signed/blob/gh-pages/lib/asn1.js // Fedor, you are amazing. 'use strict' @@ -43657,7 +44107,7 @@ exports.signature = asn1.define('signature', function () { ) }) -},{"./certificate":330,"asn1.js":4}],330:[function(require,module,exports){ +},{"./certificate":329,"asn1.js":4}],329:[function(require,module,exports){ // from https://github.com/Rantanen/node-dtls/blob/25a7dc861bda38cfeac93a723500eea4f0ac2e86/Certificate.js // thanks to @Rantanen @@ -43748,7 +44198,7 @@ var X509Certificate = asn.define('X509Certificate', function () { module.exports = X509Certificate -},{"asn1.js":4}],331:[function(require,module,exports){ +},{"asn1.js":4}],330:[function(require,module,exports){ // adapted from https://github.com/apatil/pemstrip var findProc = /Proc-Type: 4,ENCRYPTED[\n\r]+DEK-Info: AES-((?:128)|(?:192)|(?:256))-CBC,([0-9A-H]+)[\n\r]+([0-9A-z\n\r+/=]+)[\n\r]+/m var startRegex = /^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----/m @@ -43781,7 +44231,7 @@ module.exports = function (okey, password) { } } -},{"browserify-aes":76,"evp_bytestokey":197,"safe-buffer":386}],332:[function(require,module,exports){ +},{"browserify-aes":70,"evp_bytestokey":194,"safe-buffer":383}],331:[function(require,module,exports){ var asn1 = require('./asn1') var aesid = require('./aesid.json') var fixProc = require('./fixProc') @@ -43890,7 +44340,7 @@ function decrypt (data, password) { return Buffer.concat(out) } -},{"./aesid.json":328,"./asn1":329,"./fixProc":331,"browserify-aes":76,"pbkdf2":335,"safe-buffer":386}],333:[function(require,module,exports){ +},{"./aesid.json":327,"./asn1":328,"./fixProc":330,"browserify-aes":70,"pbkdf2":334,"safe-buffer":383}],332:[function(require,module,exports){ (function (Buffer){(function (){ /*! parse-torrent. MIT License. WebTorrent LLC */ /* global Blob */ @@ -44163,7 +44613,7 @@ function ensure (bool, fieldName) { ;(() => { Buffer.alloc(0) })() }).call(this)}).call(this,require("buffer").Buffer) -},{"bencode":23,"blob-to-buffer":54,"buffer":116,"fs":73,"magnet-uri":263,"path":334,"queue-microtask":355,"simple-get":397,"simple-sha1":417}],334:[function(require,module,exports){ +},{"bencode":23,"blob-to-buffer":48,"buffer":110,"fs":67,"magnet-uri":257,"path":333,"queue-microtask":354,"simple-get":394,"simple-sha1":411}],333:[function(require,module,exports){ (function (process){(function (){ // 'path' module extracted from Node.js v8.11.1 (only the posix part) // transplited with Babel @@ -44696,11 +45146,11 @@ posix.posix = posix; module.exports = posix; }).call(this)}).call(this,require('_process')) -},{"_process":342}],335:[function(require,module,exports){ +},{"_process":341}],334:[function(require,module,exports){ exports.pbkdf2 = require('./lib/async') exports.pbkdf2Sync = require('./lib/sync') -},{"./lib/async":336,"./lib/sync":339}],336:[function(require,module,exports){ +},{"./lib/async":335,"./lib/sync":338}],335:[function(require,module,exports){ (function (global){(function (){ var Buffer = require('safe-buffer').Buffer @@ -44822,7 +45272,7 @@ module.exports = function (password, salt, iterations, keylen, digest, callback) } }).call(this)}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{"./default-encoding":337,"./precondition":338,"./sync":339,"./to-buffer":340,"safe-buffer":386}],337:[function(require,module,exports){ +},{"./default-encoding":336,"./precondition":337,"./sync":338,"./to-buffer":339,"safe-buffer":383}],336:[function(require,module,exports){ (function (process,global){(function (){ var defaultEncoding /* istanbul ignore next */ @@ -44838,7 +45288,7 @@ if (global.process && global.process.browser) { module.exports = defaultEncoding }).call(this)}).call(this,require('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{"_process":342}],338:[function(require,module,exports){ +},{"_process":341}],337:[function(require,module,exports){ var MAX_ALLOC = Math.pow(2, 30) - 1 // default in iojs module.exports = function (iterations, keylen) { @@ -44859,7 +45309,7 @@ module.exports = function (iterations, keylen) { } } -},{}],339:[function(require,module,exports){ +},{}],338:[function(require,module,exports){ var md5 = require('create-hash/md5') var RIPEMD160 = require('ripemd160') var sha = require('sha.js') @@ -44966,7 +45416,7 @@ function pbkdf2 (password, salt, iterations, keylen, digest) { module.exports = pbkdf2 -},{"./default-encoding":337,"./precondition":338,"./to-buffer":340,"create-hash/md5":146,"ripemd160":382,"safe-buffer":386,"sha.js":389}],340:[function(require,module,exports){ +},{"./default-encoding":336,"./precondition":337,"./to-buffer":339,"create-hash/md5":141,"ripemd160":379,"safe-buffer":383,"sha.js":386}],339:[function(require,module,exports){ var Buffer = require('safe-buffer').Buffer module.exports = function (thing, encoding, name) { @@ -44981,14 +45431,14 @@ module.exports = function (thing, encoding, name) { } } -},{"safe-buffer":386}],341:[function(require,module,exports){ +},{"safe-buffer":383}],340:[function(require,module,exports){ module.exports = length function length (bytes) { return Math.max(16384, 1 << Math.log2(bytes < 1024 ? 1 : bytes / 1024) + 0.5 | 0) } -},{}],342:[function(require,module,exports){ +},{}],341:[function(require,module,exports){ // shim for using process in browser var process = module.exports = {}; @@ -45174,7 +45624,7 @@ process.chdir = function (dir) { }; process.umask = function() { return 0; }; -},{}],343:[function(require,module,exports){ +},{}],342:[function(require,module,exports){ exports.publicEncrypt = require('./publicEncrypt') exports.privateDecrypt = require('./privateDecrypt') @@ -45186,7 +45636,7 @@ exports.publicDecrypt = function publicDecrypt (key, buf) { return exports.privateDecrypt(key, buf, true) } -},{"./privateDecrypt":346,"./publicEncrypt":347}],344:[function(require,module,exports){ +},{"./privateDecrypt":345,"./publicEncrypt":346}],343:[function(require,module,exports){ var createHash = require('create-hash') var Buffer = require('safe-buffer').Buffer @@ -45207,9 +45657,9 @@ function i2ops (c) { return out } -},{"create-hash":145,"safe-buffer":386}],345:[function(require,module,exports){ +},{"create-hash":140,"safe-buffer":383}],344:[function(require,module,exports){ arguments[4][18][0].apply(exports,arguments) -},{"buffer":73,"dup":18}],346:[function(require,module,exports){ +},{"buffer":67,"dup":18}],345:[function(require,module,exports){ var parseKeys = require('parse-asn1') var mgf = require('./mgf') var xor = require('./xor') @@ -45316,7 +45766,7 @@ function compare (a, b) { return dif } -},{"./mgf":344,"./withPublic":348,"./xor":349,"bn.js":345,"browserify-rsa":94,"create-hash":145,"parse-asn1":332,"safe-buffer":386}],347:[function(require,module,exports){ +},{"./mgf":343,"./withPublic":347,"./xor":348,"bn.js":344,"browserify-rsa":88,"create-hash":140,"parse-asn1":331,"safe-buffer":383}],346:[function(require,module,exports){ var parseKeys = require('parse-asn1') var randomBytes = require('randombytes') var createHash = require('create-hash') @@ -45406,7 +45856,7 @@ function nonZero (len) { return out } -},{"./mgf":344,"./withPublic":348,"./xor":349,"bn.js":345,"browserify-rsa":94,"create-hash":145,"parse-asn1":332,"randombytes":358,"safe-buffer":386}],348:[function(require,module,exports){ +},{"./mgf":343,"./withPublic":347,"./xor":348,"bn.js":344,"browserify-rsa":88,"create-hash":140,"parse-asn1":331,"randombytes":357,"safe-buffer":383}],347:[function(require,module,exports){ var BN = require('bn.js') var Buffer = require('safe-buffer').Buffer @@ -45420,7 +45870,7 @@ function withPublic (paddedMsg, key) { module.exports = withPublic -},{"bn.js":345,"safe-buffer":386}],349:[function(require,module,exports){ +},{"bn.js":344,"safe-buffer":383}],348:[function(require,module,exports){ module.exports = function xor (a, b) { var len = a.length var i = -1 @@ -45430,7 +45880,7 @@ module.exports = function xor (a, b) { return a } -},{}],350:[function(require,module,exports){ +},{}],349:[function(require,module,exports){ (function (process){(function (){ var once = require('once') var eos = require('end-of-stream') @@ -45516,7 +45966,7 @@ var pump = function () { module.exports = pump }).call(this)}).call(this,require('_process')) -},{"_process":342,"end-of-stream":194,"fs":73,"once":327}],351:[function(require,module,exports){ +},{"_process":341,"end-of-stream":191,"fs":67,"once":326}],350:[function(require,module,exports){ (function (global){(function (){ /*! https://mths.be/punycode v1.4.1 by @mathias */ ;(function(root) { @@ -46053,7 +46503,7 @@ module.exports = pump }(this)); }).call(this)}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{}],352:[function(require,module,exports){ +},{}],351:[function(require,module,exports){ // Copyright Joyent, Inc. and other Node contributors. // // Permission is hereby granted, free of charge, to any person obtaining a @@ -46139,7 +46589,7 @@ var isArray = Array.isArray || function (xs) { return Object.prototype.toString.call(xs) === '[object Array]'; }; -},{}],353:[function(require,module,exports){ +},{}],352:[function(require,module,exports){ // Copyright Joyent, Inc. and other Node contributors. // // Permission is hereby granted, free of charge, to any person obtaining a @@ -46226,13 +46676,13 @@ var objectKeys = Object.keys || function (obj) { return res; }; -},{}],354:[function(require,module,exports){ +},{}],353:[function(require,module,exports){ 'use strict'; exports.decode = exports.parse = require('./decode'); exports.encode = exports.stringify = require('./encode'); -},{"./decode":352,"./encode":353}],355:[function(require,module,exports){ +},{"./decode":351,"./encode":352}],354:[function(require,module,exports){ (function (global){(function (){ /*! queue-microtask. MIT License. Feross Aboukhadijeh */ let promise @@ -46245,10 +46695,10 @@ module.exports = typeof queueMicrotask === 'function' .catch(err => setTimeout(() => { throw err }, 0)) }).call(this)}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{}],356:[function(require,module,exports){ +},{}],355:[function(require,module,exports){ module.exports = typeof queueMicrotask === 'function' ? queueMicrotask : (fn) => Promise.resolve().then(fn) -},{}],357:[function(require,module,exports){ +},{}],356:[function(require,module,exports){ var iterate = function (list) { var offset = 0 return function () { @@ -46269,7 +46719,7 @@ var iterate = function (list) { module.exports = iterate -},{}],358:[function(require,module,exports){ +},{}],357:[function(require,module,exports){ (function (process,global){(function (){ 'use strict' @@ -46323,7 +46773,7 @@ function randomBytes (size, cb) { } }).call(this)}).call(this,require('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{"_process":342,"safe-buffer":386}],359:[function(require,module,exports){ +},{"_process":341,"safe-buffer":383}],358:[function(require,module,exports){ (function (process,global){(function (){ 'use strict' @@ -46435,7 +46885,171 @@ function randomFillSync (buf, offset, size) { } }).call(this)}).call(this,require('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{"_process":342,"randombytes":358,"safe-buffer":386}],360:[function(require,module,exports){ +},{"_process":341,"randombytes":357,"safe-buffer":383}],359:[function(require,module,exports){ +/*! + * range-parser + * Copyright(c) 2012-2014 TJ Holowaychuk + * Copyright(c) 2015-2016 Douglas Christopher Wilson + * MIT Licensed + */ + +'use strict' + +/** + * Module exports. + * @public + */ + +module.exports = rangeParser + +/** + * Parse "Range" header `str` relative to the given file `size`. + * + * @param {Number} size + * @param {String} str + * @param {Object} [options] + * @return {Array} + * @public + */ + +function rangeParser (size, str, options) { + if (typeof str !== 'string') { + throw new TypeError('argument str must be a string') + } + + var index = str.indexOf('=') + + if (index === -1) { + return -2 + } + + // split the range string + var arr = str.slice(index + 1).split(',') + var ranges = [] + + // add ranges type + ranges.type = str.slice(0, index) + + // parse all ranges + for (var i = 0; i < arr.length; i++) { + var range = arr[i].split('-') + var start = parseInt(range[0], 10) + var end = parseInt(range[1], 10) + + // -nnn + if (isNaN(start)) { + start = size - end + end = size - 1 + // nnn- + } else if (isNaN(end)) { + end = size - 1 + } + + // limit last-byte-pos to current length + if (end > size - 1) { + end = size - 1 + } + + // invalid or unsatisifiable + if (isNaN(start) || isNaN(end) || start > end || start < 0) { + continue + } + + // add range + ranges.push({ + start: start, + end: end + }) + } + + if (ranges.length < 1) { + // unsatisifiable + return -1 + } + + return options && options.combine + ? combineRanges(ranges) + : ranges +} + +/** + * Combine overlapping & adjacent ranges. + * @private + */ + +function combineRanges (ranges) { + var ordered = ranges.map(mapWithIndex).sort(sortByRangeStart) + + for (var j = 0, i = 1; i < ordered.length; i++) { + var range = ordered[i] + var current = ordered[j] + + if (range.start > current.end + 1) { + // next range + ordered[++j] = range + } else if (range.end > current.end) { + // extend range + current.end = range.end + current.index = Math.min(current.index, range.index) + } + } + + // trim ordered array + ordered.length = j + 1 + + // generate combined range + var combined = ordered.sort(sortByRangeIndex).map(mapWithoutIndex) + + // copy ranges type + combined.type = ranges.type + + return combined +} + +/** + * Map function to add index value to ranges. + * @private + */ + +function mapWithIndex (range, index) { + return { + start: range.start, + end: range.end, + index: index + } +} + +/** + * Map function to remove index value from ranges. + * @private + */ + +function mapWithoutIndex (range) { + return { + start: range.start, + end: range.end + } +} + +/** + * Sort function to sort ranges by index. + * @private + */ + +function sortByRangeIndex (a, b) { + return a.index - b.index +} + +/** + * Sort function to sort ranges by start position. + * @private + */ + +function sortByRangeStart (a, b) { + return a.start - b.start +} + +},{}],360:[function(require,module,exports){ /* Instance of writable stream. @@ -46553,36 +47167,36 @@ class RangeSliceStream extends Writable { module.exports = RangeSliceStream },{"readable-stream":375}],361:[function(require,module,exports){ +arguments[4][29][0].apply(exports,arguments) +},{"dup":29}],362:[function(require,module,exports){ +arguments[4][30][0].apply(exports,arguments) +},{"./_stream_readable":364,"./_stream_writable":366,"_process":341,"dup":30,"inherits":246}],363:[function(require,module,exports){ +arguments[4][31][0].apply(exports,arguments) +},{"./_stream_transform":365,"dup":31,"inherits":246}],364:[function(require,module,exports){ arguments[4][32][0].apply(exports,arguments) -},{"dup":32}],362:[function(require,module,exports){ +},{"../errors":361,"./_stream_duplex":362,"./internal/streams/async_iterator":367,"./internal/streams/buffer_list":368,"./internal/streams/destroy":369,"./internal/streams/from":371,"./internal/streams/state":373,"./internal/streams/stream":374,"_process":341,"buffer":110,"dup":32,"events":193,"inherits":246,"string_decoder/":472,"util":67}],365:[function(require,module,exports){ arguments[4][33][0].apply(exports,arguments) -},{"./_stream_readable":364,"./_stream_writable":366,"_process":342,"dup":33,"inherits":249}],363:[function(require,module,exports){ +},{"../errors":361,"./_stream_duplex":362,"dup":33,"inherits":246}],366:[function(require,module,exports){ arguments[4][34][0].apply(exports,arguments) -},{"./_stream_transform":365,"dup":34,"inherits":249}],364:[function(require,module,exports){ +},{"../errors":361,"./_stream_duplex":362,"./internal/streams/destroy":369,"./internal/streams/state":373,"./internal/streams/stream":374,"_process":341,"buffer":110,"dup":34,"inherits":246,"util-deprecate":485}],367:[function(require,module,exports){ arguments[4][35][0].apply(exports,arguments) -},{"../errors":361,"./_stream_duplex":362,"./internal/streams/async_iterator":367,"./internal/streams/buffer_list":368,"./internal/streams/destroy":369,"./internal/streams/from":371,"./internal/streams/state":373,"./internal/streams/stream":374,"_process":342,"buffer":116,"dup":35,"events":196,"inherits":249,"string_decoder/":481,"util":73}],365:[function(require,module,exports){ +},{"./end-of-stream":370,"_process":341,"dup":35}],368:[function(require,module,exports){ arguments[4][36][0].apply(exports,arguments) -},{"../errors":361,"./_stream_duplex":362,"dup":36,"inherits":249}],366:[function(require,module,exports){ +},{"buffer":110,"dup":36,"util":67}],369:[function(require,module,exports){ arguments[4][37][0].apply(exports,arguments) -},{"../errors":361,"./_stream_duplex":362,"./internal/streams/destroy":369,"./internal/streams/state":373,"./internal/streams/stream":374,"_process":342,"buffer":116,"dup":37,"inherits":249,"util-deprecate":500}],367:[function(require,module,exports){ +},{"_process":341,"dup":37}],370:[function(require,module,exports){ arguments[4][38][0].apply(exports,arguments) -},{"./end-of-stream":370,"_process":342,"dup":38}],368:[function(require,module,exports){ +},{"../../../errors":361,"dup":38}],371:[function(require,module,exports){ arguments[4][39][0].apply(exports,arguments) -},{"buffer":116,"dup":39,"util":73}],369:[function(require,module,exports){ +},{"dup":39}],372:[function(require,module,exports){ arguments[4][40][0].apply(exports,arguments) -},{"_process":342,"dup":40}],370:[function(require,module,exports){ +},{"../../../errors":361,"./end-of-stream":370,"dup":40}],373:[function(require,module,exports){ arguments[4][41][0].apply(exports,arguments) -},{"../../../errors":361,"dup":41}],371:[function(require,module,exports){ +},{"../../../errors":361,"dup":41}],374:[function(require,module,exports){ arguments[4][42][0].apply(exports,arguments) -},{"dup":42}],372:[function(require,module,exports){ +},{"dup":42,"events":193}],375:[function(require,module,exports){ arguments[4][43][0].apply(exports,arguments) -},{"../../../errors":361,"./end-of-stream":370,"dup":43}],373:[function(require,module,exports){ -arguments[4][44][0].apply(exports,arguments) -},{"../../../errors":361,"dup":44}],374:[function(require,module,exports){ -arguments[4][45][0].apply(exports,arguments) -},{"dup":45,"events":196}],375:[function(require,module,exports){ -arguments[4][46][0].apply(exports,arguments) -},{"./lib/_stream_duplex.js":362,"./lib/_stream_passthrough.js":363,"./lib/_stream_readable.js":364,"./lib/_stream_transform.js":365,"./lib/_stream_writable.js":366,"./lib/internal/streams/end-of-stream.js":370,"./lib/internal/streams/pipeline.js":372,"dup":46}],376:[function(require,module,exports){ +},{"./lib/_stream_duplex.js":362,"./lib/_stream_passthrough.js":363,"./lib/_stream_readable.js":364,"./lib/_stream_transform.js":365,"./lib/_stream_writable.js":366,"./lib/internal/streams/end-of-stream.js":370,"./lib/internal/streams/pipeline.js":372,"dup":43}],376:[function(require,module,exports){ "use strict"; // Based on RC4 algorithm, as described in @@ -47189,7 +47803,7 @@ function setMediaOpts (elem, opts) { elem.controls = !!opts.controls } -},{"./lib/mime.json":378,"debug":379,"is-ascii":250,"mediasource":265,"path":334,"stream-to-blob-url":477,"videostream":502}],378:[function(require,module,exports){ +},{"./lib/mime.json":378,"debug":161,"is-ascii":247,"mediasource":259,"path":333,"stream-to-blob-url":468,"videostream":487}],378:[function(require,module,exports){ module.exports={ ".3gp": "video/3gpp", ".aac": "audio/aac", @@ -47275,12 +47889,6 @@ module.exports={ } },{}],379:[function(require,module,exports){ -arguments[4][29][0].apply(exports,arguments) -},{"./common":380,"_process":342,"dup":29}],380:[function(require,module,exports){ -arguments[4][30][0].apply(exports,arguments) -},{"dup":30,"ms":381}],381:[function(require,module,exports){ -arguments[4][31][0].apply(exports,arguments) -},{"dup":31}],382:[function(require,module,exports){ 'use strict' var Buffer = require('buffer').Buffer var inherits = require('inherits') @@ -47445,7 +48053,7 @@ function fn5 (a, b, c, d, e, m, k, s) { module.exports = RIPEMD160 -},{"buffer":116,"hash-base":217,"inherits":249}],383:[function(require,module,exports){ +},{"buffer":110,"hash-base":214,"inherits":246}],380:[function(require,module,exports){ /*! run-parallel-limit. MIT License. Feross Aboukhadijeh */ module.exports = runParallelLimit @@ -47517,7 +48125,7 @@ function runParallelLimit (tasks, limit, cb) { isSync = false } -},{"queue-microtask":355}],384:[function(require,module,exports){ +},{"queue-microtask":354}],381:[function(require,module,exports){ /*! run-parallel. MIT License. Feross Aboukhadijeh */ module.exports = runParallel @@ -47570,7 +48178,7 @@ function runParallel (tasks, cb) { isSync = false } -},{"queue-microtask":355}],385:[function(require,module,exports){ +},{"queue-microtask":354}],382:[function(require,module,exports){ (function webpackUniversalModuleDefinition(root, factory) { if(typeof exports === 'object' && typeof module === 'object') module.exports = factory(); @@ -48511,7 +49119,7 @@ module.exports = function () { /***/ }) /******/ ]); }); -},{}],386:[function(require,module,exports){ +},{}],383:[function(require,module,exports){ /*! safe-buffer. MIT License. Feross Aboukhadijeh */ /* eslint-disable node/no-deprecated-api */ var buffer = require('buffer') @@ -48578,7 +49186,7 @@ SafeBuffer.allocUnsafeSlow = function (size) { return buffer.SlowBuffer(size) } -},{"buffer":116}],387:[function(require,module,exports){ +},{"buffer":110}],384:[function(require,module,exports){ (function (process){(function (){ /* eslint-disable node/no-deprecated-api */ @@ -48659,7 +49267,7 @@ if (!safer.constants) { module.exports = safer }).call(this)}).call(this,require('_process')) -},{"_process":342,"buffer":116}],388:[function(require,module,exports){ +},{"_process":341,"buffer":110}],385:[function(require,module,exports){ var Buffer = require('safe-buffer').Buffer // prototype class for hash functions @@ -48742,7 +49350,7 @@ Hash.prototype._update = function () { module.exports = Hash -},{"safe-buffer":386}],389:[function(require,module,exports){ +},{"safe-buffer":383}],386:[function(require,module,exports){ var exports = module.exports = function SHA (algorithm) { algorithm = algorithm.toLowerCase() @@ -48759,7 +49367,7 @@ exports.sha256 = require('./sha256') exports.sha384 = require('./sha384') exports.sha512 = require('./sha512') -},{"./sha":390,"./sha1":391,"./sha224":392,"./sha256":393,"./sha384":394,"./sha512":395}],390:[function(require,module,exports){ +},{"./sha":387,"./sha1":388,"./sha224":389,"./sha256":390,"./sha384":391,"./sha512":392}],387:[function(require,module,exports){ /* * A JavaScript implementation of the Secure Hash Algorithm, SHA-0, as defined * in FIPS PUB 180-1 @@ -48855,7 +49463,7 @@ Sha.prototype._hash = function () { module.exports = Sha -},{"./hash":388,"inherits":249,"safe-buffer":386}],391:[function(require,module,exports){ +},{"./hash":385,"inherits":246,"safe-buffer":383}],388:[function(require,module,exports){ /* * A JavaScript implementation of the Secure Hash Algorithm, SHA-1, as defined * in FIPS PUB 180-1 @@ -48956,7 +49564,7 @@ Sha1.prototype._hash = function () { module.exports = Sha1 -},{"./hash":388,"inherits":249,"safe-buffer":386}],392:[function(require,module,exports){ +},{"./hash":385,"inherits":246,"safe-buffer":383}],389:[function(require,module,exports){ /** * A JavaScript implementation of the Secure Hash Algorithm, SHA-256, as defined * in FIPS 180-2 @@ -49011,7 +49619,7 @@ Sha224.prototype._hash = function () { module.exports = Sha224 -},{"./hash":388,"./sha256":393,"inherits":249,"safe-buffer":386}],393:[function(require,module,exports){ +},{"./hash":385,"./sha256":390,"inherits":246,"safe-buffer":383}],390:[function(require,module,exports){ /** * A JavaScript implementation of the Secure Hash Algorithm, SHA-256, as defined * in FIPS 180-2 @@ -49148,7 +49756,7 @@ Sha256.prototype._hash = function () { module.exports = Sha256 -},{"./hash":388,"inherits":249,"safe-buffer":386}],394:[function(require,module,exports){ +},{"./hash":385,"inherits":246,"safe-buffer":383}],391:[function(require,module,exports){ var inherits = require('inherits') var SHA512 = require('./sha512') var Hash = require('./hash') @@ -49207,7 +49815,7 @@ Sha384.prototype._hash = function () { module.exports = Sha384 -},{"./hash":388,"./sha512":395,"inherits":249,"safe-buffer":386}],395:[function(require,module,exports){ +},{"./hash":385,"./sha512":392,"inherits":246,"safe-buffer":383}],392:[function(require,module,exports){ var inherits = require('inherits') var Hash = require('./hash') var Buffer = require('safe-buffer').Buffer @@ -49469,7 +50077,7 @@ Sha512.prototype._hash = function () { module.exports = Sha512 -},{"./hash":388,"inherits":249,"safe-buffer":386}],396:[function(require,module,exports){ +},{"./hash":385,"inherits":246,"safe-buffer":383}],393:[function(require,module,exports){ (function (Buffer){(function (){ /*! simple-concat. MIT License. Feross Aboukhadijeh */ module.exports = function (stream, cb) { @@ -49488,7 +50096,7 @@ module.exports = function (stream, cb) { } }).call(this)}).call(this,require("buffer").Buffer) -},{"buffer":116}],397:[function(require,module,exports){ +},{"buffer":110}],394:[function(require,module,exports){ (function (Buffer){(function (){ /*! simple-get. MIT License. Feross Aboukhadijeh */ module.exports = simpleGet @@ -49592,7 +50200,7 @@ simpleGet.concat = (opts, cb) => { }) }).call(this)}).call(this,require("buffer").Buffer) -},{"buffer":116,"decompress-response":73,"http":458,"https":246,"once":327,"querystring":354,"simple-concat":396,"url":494}],398:[function(require,module,exports){ +},{"buffer":110,"decompress-response":67,"http":449,"https":243,"once":326,"querystring":353,"simple-concat":393,"url":482}],395:[function(require,module,exports){ /*! simple-peer. MIT License. Feross Aboukhadijeh */ const debug = require('debug')('simple-peer') const getBrowserRTC = require('get-browser-rtc') @@ -50646,43 +51254,37 @@ Peer.channelConfig = {} module.exports = Peer -},{"buffer":116,"debug":399,"err-code":195,"get-browser-rtc":216,"queue-microtask":355,"randombytes":358,"readable-stream":416}],399:[function(require,module,exports){ +},{"buffer":110,"debug":161,"err-code":192,"get-browser-rtc":213,"queue-microtask":354,"randombytes":357,"readable-stream":410}],396:[function(require,module,exports){ arguments[4][29][0].apply(exports,arguments) -},{"./common":400,"_process":342,"dup":29}],400:[function(require,module,exports){ +},{"dup":29}],397:[function(require,module,exports){ arguments[4][30][0].apply(exports,arguments) -},{"dup":30,"ms":401}],401:[function(require,module,exports){ +},{"./_stream_readable":399,"./_stream_writable":401,"_process":341,"dup":30,"inherits":246}],398:[function(require,module,exports){ arguments[4][31][0].apply(exports,arguments) -},{"dup":31}],402:[function(require,module,exports){ +},{"./_stream_transform":400,"dup":31,"inherits":246}],399:[function(require,module,exports){ arguments[4][32][0].apply(exports,arguments) -},{"dup":32}],403:[function(require,module,exports){ +},{"../errors":396,"./_stream_duplex":397,"./internal/streams/async_iterator":402,"./internal/streams/buffer_list":403,"./internal/streams/destroy":404,"./internal/streams/from":406,"./internal/streams/state":408,"./internal/streams/stream":409,"_process":341,"buffer":110,"dup":32,"events":193,"inherits":246,"string_decoder/":472,"util":67}],400:[function(require,module,exports){ arguments[4][33][0].apply(exports,arguments) -},{"./_stream_readable":405,"./_stream_writable":407,"_process":342,"dup":33,"inherits":249}],404:[function(require,module,exports){ +},{"../errors":396,"./_stream_duplex":397,"dup":33,"inherits":246}],401:[function(require,module,exports){ arguments[4][34][0].apply(exports,arguments) -},{"./_stream_transform":406,"dup":34,"inherits":249}],405:[function(require,module,exports){ +},{"../errors":396,"./_stream_duplex":397,"./internal/streams/destroy":404,"./internal/streams/state":408,"./internal/streams/stream":409,"_process":341,"buffer":110,"dup":34,"inherits":246,"util-deprecate":485}],402:[function(require,module,exports){ arguments[4][35][0].apply(exports,arguments) -},{"../errors":402,"./_stream_duplex":403,"./internal/streams/async_iterator":408,"./internal/streams/buffer_list":409,"./internal/streams/destroy":410,"./internal/streams/from":412,"./internal/streams/state":414,"./internal/streams/stream":415,"_process":342,"buffer":116,"dup":35,"events":196,"inherits":249,"string_decoder/":481,"util":73}],406:[function(require,module,exports){ +},{"./end-of-stream":405,"_process":341,"dup":35}],403:[function(require,module,exports){ arguments[4][36][0].apply(exports,arguments) -},{"../errors":402,"./_stream_duplex":403,"dup":36,"inherits":249}],407:[function(require,module,exports){ +},{"buffer":110,"dup":36,"util":67}],404:[function(require,module,exports){ arguments[4][37][0].apply(exports,arguments) -},{"../errors":402,"./_stream_duplex":403,"./internal/streams/destroy":410,"./internal/streams/state":414,"./internal/streams/stream":415,"_process":342,"buffer":116,"dup":37,"inherits":249,"util-deprecate":500}],408:[function(require,module,exports){ +},{"_process":341,"dup":37}],405:[function(require,module,exports){ arguments[4][38][0].apply(exports,arguments) -},{"./end-of-stream":411,"_process":342,"dup":38}],409:[function(require,module,exports){ +},{"../../../errors":396,"dup":38}],406:[function(require,module,exports){ arguments[4][39][0].apply(exports,arguments) -},{"buffer":116,"dup":39,"util":73}],410:[function(require,module,exports){ +},{"dup":39}],407:[function(require,module,exports){ arguments[4][40][0].apply(exports,arguments) -},{"_process":342,"dup":40}],411:[function(require,module,exports){ +},{"../../../errors":396,"./end-of-stream":405,"dup":40}],408:[function(require,module,exports){ arguments[4][41][0].apply(exports,arguments) -},{"../../../errors":402,"dup":41}],412:[function(require,module,exports){ +},{"../../../errors":396,"dup":41}],409:[function(require,module,exports){ arguments[4][42][0].apply(exports,arguments) -},{"dup":42}],413:[function(require,module,exports){ +},{"dup":42,"events":193}],410:[function(require,module,exports){ arguments[4][43][0].apply(exports,arguments) -},{"../../../errors":402,"./end-of-stream":411,"dup":43}],414:[function(require,module,exports){ -arguments[4][44][0].apply(exports,arguments) -},{"../../../errors":402,"dup":44}],415:[function(require,module,exports){ -arguments[4][45][0].apply(exports,arguments) -},{"dup":45,"events":196}],416:[function(require,module,exports){ -arguments[4][46][0].apply(exports,arguments) -},{"./lib/_stream_duplex.js":403,"./lib/_stream_passthrough.js":404,"./lib/_stream_readable.js":405,"./lib/_stream_transform.js":406,"./lib/_stream_writable.js":407,"./lib/internal/streams/end-of-stream.js":411,"./lib/internal/streams/pipeline.js":413,"dup":46}],417:[function(require,module,exports){ +},{"./lib/_stream_duplex.js":397,"./lib/_stream_passthrough.js":398,"./lib/_stream_readable.js":399,"./lib/_stream_transform.js":400,"./lib/_stream_writable.js":401,"./lib/internal/streams/end-of-stream.js":405,"./lib/internal/streams/pipeline.js":407,"dup":43}],411:[function(require,module,exports){ /* global self */ const Rusha = require('rusha') @@ -50760,7 +51362,7 @@ function hex (buf) { module.exports = sha1 module.exports.sync = sha1sync -},{"./rusha-worker-sha1":418,"rusha":385}],418:[function(require,module,exports){ +},{"./rusha-worker-sha1":412,"rusha":382}],412:[function(require,module,exports){ const Rusha = require('rusha') let worker @@ -50795,7 +51397,7 @@ function sha1 (buf, cb) { module.exports = sha1 -},{"rusha":385}],419:[function(require,module,exports){ +},{"rusha":382}],413:[function(require,module,exports){ (function (Buffer){(function (){ /*! simple-websocket. MIT License. Feross Aboukhadijeh */ /* global WebSocket */ @@ -51058,43 +51660,37 @@ Socket.WEBSOCKET_SUPPORT = !!_WebSocket module.exports = Socket }).call(this)}).call(this,require("buffer").Buffer) -},{"buffer":116,"debug":420,"queue-microtask":355,"randombytes":358,"readable-stream":437,"ws":73}],420:[function(require,module,exports){ +},{"buffer":110,"debug":161,"queue-microtask":354,"randombytes":357,"readable-stream":428,"ws":67}],414:[function(require,module,exports){ arguments[4][29][0].apply(exports,arguments) -},{"./common":421,"_process":342,"dup":29}],421:[function(require,module,exports){ +},{"dup":29}],415:[function(require,module,exports){ arguments[4][30][0].apply(exports,arguments) -},{"dup":30,"ms":422}],422:[function(require,module,exports){ +},{"./_stream_readable":417,"./_stream_writable":419,"_process":341,"dup":30,"inherits":246}],416:[function(require,module,exports){ arguments[4][31][0].apply(exports,arguments) -},{"dup":31}],423:[function(require,module,exports){ +},{"./_stream_transform":418,"dup":31,"inherits":246}],417:[function(require,module,exports){ arguments[4][32][0].apply(exports,arguments) -},{"dup":32}],424:[function(require,module,exports){ +},{"../errors":414,"./_stream_duplex":415,"./internal/streams/async_iterator":420,"./internal/streams/buffer_list":421,"./internal/streams/destroy":422,"./internal/streams/from":424,"./internal/streams/state":426,"./internal/streams/stream":427,"_process":341,"buffer":110,"dup":32,"events":193,"inherits":246,"string_decoder/":472,"util":67}],418:[function(require,module,exports){ arguments[4][33][0].apply(exports,arguments) -},{"./_stream_readable":426,"./_stream_writable":428,"_process":342,"dup":33,"inherits":249}],425:[function(require,module,exports){ +},{"../errors":414,"./_stream_duplex":415,"dup":33,"inherits":246}],419:[function(require,module,exports){ arguments[4][34][0].apply(exports,arguments) -},{"./_stream_transform":427,"dup":34,"inherits":249}],426:[function(require,module,exports){ +},{"../errors":414,"./_stream_duplex":415,"./internal/streams/destroy":422,"./internal/streams/state":426,"./internal/streams/stream":427,"_process":341,"buffer":110,"dup":34,"inherits":246,"util-deprecate":485}],420:[function(require,module,exports){ arguments[4][35][0].apply(exports,arguments) -},{"../errors":423,"./_stream_duplex":424,"./internal/streams/async_iterator":429,"./internal/streams/buffer_list":430,"./internal/streams/destroy":431,"./internal/streams/from":433,"./internal/streams/state":435,"./internal/streams/stream":436,"_process":342,"buffer":116,"dup":35,"events":196,"inherits":249,"string_decoder/":481,"util":73}],427:[function(require,module,exports){ +},{"./end-of-stream":423,"_process":341,"dup":35}],421:[function(require,module,exports){ arguments[4][36][0].apply(exports,arguments) -},{"../errors":423,"./_stream_duplex":424,"dup":36,"inherits":249}],428:[function(require,module,exports){ +},{"buffer":110,"dup":36,"util":67}],422:[function(require,module,exports){ arguments[4][37][0].apply(exports,arguments) -},{"../errors":423,"./_stream_duplex":424,"./internal/streams/destroy":431,"./internal/streams/state":435,"./internal/streams/stream":436,"_process":342,"buffer":116,"dup":37,"inherits":249,"util-deprecate":500}],429:[function(require,module,exports){ +},{"_process":341,"dup":37}],423:[function(require,module,exports){ arguments[4][38][0].apply(exports,arguments) -},{"./end-of-stream":432,"_process":342,"dup":38}],430:[function(require,module,exports){ +},{"../../../errors":414,"dup":38}],424:[function(require,module,exports){ arguments[4][39][0].apply(exports,arguments) -},{"buffer":116,"dup":39,"util":73}],431:[function(require,module,exports){ +},{"dup":39}],425:[function(require,module,exports){ arguments[4][40][0].apply(exports,arguments) -},{"_process":342,"dup":40}],432:[function(require,module,exports){ +},{"../../../errors":414,"./end-of-stream":423,"dup":40}],426:[function(require,module,exports){ arguments[4][41][0].apply(exports,arguments) -},{"../../../errors":423,"dup":41}],433:[function(require,module,exports){ +},{"../../../errors":414,"dup":41}],427:[function(require,module,exports){ arguments[4][42][0].apply(exports,arguments) -},{"dup":42}],434:[function(require,module,exports){ +},{"dup":42,"events":193}],428:[function(require,module,exports){ arguments[4][43][0].apply(exports,arguments) -},{"../../../errors":423,"./end-of-stream":432,"dup":43}],435:[function(require,module,exports){ -arguments[4][44][0].apply(exports,arguments) -},{"../../../errors":423,"dup":44}],436:[function(require,module,exports){ -arguments[4][45][0].apply(exports,arguments) -},{"dup":45,"events":196}],437:[function(require,module,exports){ -arguments[4][46][0].apply(exports,arguments) -},{"./lib/_stream_duplex.js":424,"./lib/_stream_passthrough.js":425,"./lib/_stream_readable.js":426,"./lib/_stream_transform.js":427,"./lib/_stream_writable.js":428,"./lib/internal/streams/end-of-stream.js":432,"./lib/internal/streams/pipeline.js":434,"dup":46}],438:[function(require,module,exports){ +},{"./lib/_stream_duplex.js":415,"./lib/_stream_passthrough.js":416,"./lib/_stream_readable.js":417,"./lib/_stream_transform.js":418,"./lib/_stream_writable.js":419,"./lib/internal/streams/end-of-stream.js":423,"./lib/internal/streams/pipeline.js":425,"dup":43}],429:[function(require,module,exports){ const Throttle = require('./lib/throttle') const ThrottleGroup = require('./lib/throttle-group') @@ -51103,7 +51699,7 @@ module.exports = { ThrottleGroup } -},{"./lib/throttle":440,"./lib/throttle-group":439}],439:[function(require,module,exports){ +},{"./lib/throttle":431,"./lib/throttle-group":430}],430:[function(require,module,exports){ const { TokenBucket } = require('limiter') const Throttle = require('./throttle') @@ -51196,7 +51792,7 @@ class ThrottleGroup { module.exports = ThrottleGroup -},{"./throttle":440,"limiter":254}],440:[function(require,module,exports){ +},{"./throttle":431,"limiter":251}],431:[function(require,module,exports){ const { EventEmitter } = require('events') const { Transform } = require('streamx') const { wait } = require('./utils') @@ -51341,7 +51937,7 @@ module.exports = Throttle // Fix circular dependency const ThrottleGroup = require('./throttle-group') -},{"./throttle-group":439,"./utils":441,"events":196,"streamx":480}],441:[function(require,module,exports){ +},{"./throttle-group":430,"./utils":432,"events":193,"streamx":471}],432:[function(require,module,exports){ function wait (time) { return new Promise((resolve) => setTimeout(resolve, time)) } @@ -51350,7 +51946,7 @@ module.exports = { wait } -},{}],442:[function(require,module,exports){ +},{}],433:[function(require,module,exports){ var tick = 1 var maxTick = 65535 var resolution = 4 @@ -51391,7 +51987,7 @@ module.exports = function (seconds) { } } -},{}],443:[function(require,module,exports){ +},{}],434:[function(require,module,exports){ // Copyright Joyent, Inc. and other Node contributors. // // Permission is hereby granted, free of charge, to any person obtaining a @@ -51522,35 +52118,35 @@ Stream.prototype.pipe = function(dest, options) { return dest; }; -},{"events":196,"inherits":249,"readable-stream/lib/_stream_duplex.js":445,"readable-stream/lib/_stream_passthrough.js":446,"readable-stream/lib/_stream_readable.js":447,"readable-stream/lib/_stream_transform.js":448,"readable-stream/lib/_stream_writable.js":449,"readable-stream/lib/internal/streams/end-of-stream.js":453,"readable-stream/lib/internal/streams/pipeline.js":455}],444:[function(require,module,exports){ +},{"events":193,"inherits":246,"readable-stream/lib/_stream_duplex.js":436,"readable-stream/lib/_stream_passthrough.js":437,"readable-stream/lib/_stream_readable.js":438,"readable-stream/lib/_stream_transform.js":439,"readable-stream/lib/_stream_writable.js":440,"readable-stream/lib/internal/streams/end-of-stream.js":444,"readable-stream/lib/internal/streams/pipeline.js":446}],435:[function(require,module,exports){ +arguments[4][29][0].apply(exports,arguments) +},{"dup":29}],436:[function(require,module,exports){ +arguments[4][30][0].apply(exports,arguments) +},{"./_stream_readable":438,"./_stream_writable":440,"_process":341,"dup":30,"inherits":246}],437:[function(require,module,exports){ +arguments[4][31][0].apply(exports,arguments) +},{"./_stream_transform":439,"dup":31,"inherits":246}],438:[function(require,module,exports){ arguments[4][32][0].apply(exports,arguments) -},{"dup":32}],445:[function(require,module,exports){ +},{"../errors":435,"./_stream_duplex":436,"./internal/streams/async_iterator":441,"./internal/streams/buffer_list":442,"./internal/streams/destroy":443,"./internal/streams/from":445,"./internal/streams/state":447,"./internal/streams/stream":448,"_process":341,"buffer":110,"dup":32,"events":193,"inherits":246,"string_decoder/":472,"util":67}],439:[function(require,module,exports){ arguments[4][33][0].apply(exports,arguments) -},{"./_stream_readable":447,"./_stream_writable":449,"_process":342,"dup":33,"inherits":249}],446:[function(require,module,exports){ +},{"../errors":435,"./_stream_duplex":436,"dup":33,"inherits":246}],440:[function(require,module,exports){ arguments[4][34][0].apply(exports,arguments) -},{"./_stream_transform":448,"dup":34,"inherits":249}],447:[function(require,module,exports){ +},{"../errors":435,"./_stream_duplex":436,"./internal/streams/destroy":443,"./internal/streams/state":447,"./internal/streams/stream":448,"_process":341,"buffer":110,"dup":34,"inherits":246,"util-deprecate":485}],441:[function(require,module,exports){ arguments[4][35][0].apply(exports,arguments) -},{"../errors":444,"./_stream_duplex":445,"./internal/streams/async_iterator":450,"./internal/streams/buffer_list":451,"./internal/streams/destroy":452,"./internal/streams/from":454,"./internal/streams/state":456,"./internal/streams/stream":457,"_process":342,"buffer":116,"dup":35,"events":196,"inherits":249,"string_decoder/":481,"util":73}],448:[function(require,module,exports){ +},{"./end-of-stream":444,"_process":341,"dup":35}],442:[function(require,module,exports){ arguments[4][36][0].apply(exports,arguments) -},{"../errors":444,"./_stream_duplex":445,"dup":36,"inherits":249}],449:[function(require,module,exports){ +},{"buffer":110,"dup":36,"util":67}],443:[function(require,module,exports){ arguments[4][37][0].apply(exports,arguments) -},{"../errors":444,"./_stream_duplex":445,"./internal/streams/destroy":452,"./internal/streams/state":456,"./internal/streams/stream":457,"_process":342,"buffer":116,"dup":37,"inherits":249,"util-deprecate":500}],450:[function(require,module,exports){ +},{"_process":341,"dup":37}],444:[function(require,module,exports){ arguments[4][38][0].apply(exports,arguments) -},{"./end-of-stream":453,"_process":342,"dup":38}],451:[function(require,module,exports){ +},{"../../../errors":435,"dup":38}],445:[function(require,module,exports){ arguments[4][39][0].apply(exports,arguments) -},{"buffer":116,"dup":39,"util":73}],452:[function(require,module,exports){ +},{"dup":39}],446:[function(require,module,exports){ arguments[4][40][0].apply(exports,arguments) -},{"_process":342,"dup":40}],453:[function(require,module,exports){ +},{"../../../errors":435,"./end-of-stream":444,"dup":40}],447:[function(require,module,exports){ arguments[4][41][0].apply(exports,arguments) -},{"../../../errors":444,"dup":41}],454:[function(require,module,exports){ +},{"../../../errors":435,"dup":41}],448:[function(require,module,exports){ arguments[4][42][0].apply(exports,arguments) -},{"dup":42}],455:[function(require,module,exports){ -arguments[4][43][0].apply(exports,arguments) -},{"../../../errors":444,"./end-of-stream":453,"dup":43}],456:[function(require,module,exports){ -arguments[4][44][0].apply(exports,arguments) -},{"../../../errors":444,"dup":44}],457:[function(require,module,exports){ -arguments[4][45][0].apply(exports,arguments) -},{"dup":45,"events":196}],458:[function(require,module,exports){ +},{"dup":42,"events":193}],449:[function(require,module,exports){ (function (global){(function (){ var ClientRequest = require('./lib/request') var response = require('./lib/response') @@ -51638,7 +52234,7 @@ http.METHODS = [ 'UNSUBSCRIBE' ] }).call(this)}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{"./lib/request":460,"./lib/response":461,"builtin-status-codes":121,"url":494,"xtend":530}],459:[function(require,module,exports){ +},{"./lib/request":451,"./lib/response":452,"builtin-status-codes":115,"url":482,"xtend":497}],450:[function(require,module,exports){ (function (global){(function (){ exports.fetch = isFunction(global.fetch) && isFunction(global.ReadableStream) @@ -51701,7 +52297,7 @@ function isFunction (value) { xhr = null // Help gc }).call(this)}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{}],460:[function(require,module,exports){ +},{}],451:[function(require,module,exports){ (function (process,global,Buffer){(function (){ var capability = require('./capability') var inherits = require('inherits') @@ -52057,7 +52653,7 @@ var unsafeHeaders = [ ] }).call(this)}).call(this,require('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {},require("buffer").Buffer) -},{"./capability":459,"./response":461,"_process":342,"buffer":116,"inherits":249,"readable-stream":476}],461:[function(require,module,exports){ +},{"./capability":450,"./response":452,"_process":341,"buffer":110,"inherits":246,"readable-stream":467}],452:[function(require,module,exports){ (function (process,global,Buffer){(function (){ var capability = require('./capability') var inherits = require('inherits') @@ -52272,37 +52868,37 @@ IncomingMessage.prototype._onXHRProgress = function (resetTimers) { } }).call(this)}).call(this,require('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {},require("buffer").Buffer) -},{"./capability":459,"_process":342,"buffer":116,"inherits":249,"readable-stream":476}],462:[function(require,module,exports){ +},{"./capability":450,"_process":341,"buffer":110,"inherits":246,"readable-stream":467}],453:[function(require,module,exports){ +arguments[4][29][0].apply(exports,arguments) +},{"dup":29}],454:[function(require,module,exports){ +arguments[4][30][0].apply(exports,arguments) +},{"./_stream_readable":456,"./_stream_writable":458,"_process":341,"dup":30,"inherits":246}],455:[function(require,module,exports){ +arguments[4][31][0].apply(exports,arguments) +},{"./_stream_transform":457,"dup":31,"inherits":246}],456:[function(require,module,exports){ arguments[4][32][0].apply(exports,arguments) -},{"dup":32}],463:[function(require,module,exports){ +},{"../errors":453,"./_stream_duplex":454,"./internal/streams/async_iterator":459,"./internal/streams/buffer_list":460,"./internal/streams/destroy":461,"./internal/streams/from":463,"./internal/streams/state":465,"./internal/streams/stream":466,"_process":341,"buffer":110,"dup":32,"events":193,"inherits":246,"string_decoder/":472,"util":67}],457:[function(require,module,exports){ arguments[4][33][0].apply(exports,arguments) -},{"./_stream_readable":465,"./_stream_writable":467,"_process":342,"dup":33,"inherits":249}],464:[function(require,module,exports){ +},{"../errors":453,"./_stream_duplex":454,"dup":33,"inherits":246}],458:[function(require,module,exports){ arguments[4][34][0].apply(exports,arguments) -},{"./_stream_transform":466,"dup":34,"inherits":249}],465:[function(require,module,exports){ +},{"../errors":453,"./_stream_duplex":454,"./internal/streams/destroy":461,"./internal/streams/state":465,"./internal/streams/stream":466,"_process":341,"buffer":110,"dup":34,"inherits":246,"util-deprecate":485}],459:[function(require,module,exports){ arguments[4][35][0].apply(exports,arguments) -},{"../errors":462,"./_stream_duplex":463,"./internal/streams/async_iterator":468,"./internal/streams/buffer_list":469,"./internal/streams/destroy":470,"./internal/streams/from":472,"./internal/streams/state":474,"./internal/streams/stream":475,"_process":342,"buffer":116,"dup":35,"events":196,"inherits":249,"string_decoder/":481,"util":73}],466:[function(require,module,exports){ +},{"./end-of-stream":462,"_process":341,"dup":35}],460:[function(require,module,exports){ arguments[4][36][0].apply(exports,arguments) -},{"../errors":462,"./_stream_duplex":463,"dup":36,"inherits":249}],467:[function(require,module,exports){ +},{"buffer":110,"dup":36,"util":67}],461:[function(require,module,exports){ arguments[4][37][0].apply(exports,arguments) -},{"../errors":462,"./_stream_duplex":463,"./internal/streams/destroy":470,"./internal/streams/state":474,"./internal/streams/stream":475,"_process":342,"buffer":116,"dup":37,"inherits":249,"util-deprecate":500}],468:[function(require,module,exports){ +},{"_process":341,"dup":37}],462:[function(require,module,exports){ arguments[4][38][0].apply(exports,arguments) -},{"./end-of-stream":471,"_process":342,"dup":38}],469:[function(require,module,exports){ +},{"../../../errors":453,"dup":38}],463:[function(require,module,exports){ arguments[4][39][0].apply(exports,arguments) -},{"buffer":116,"dup":39,"util":73}],470:[function(require,module,exports){ +},{"dup":39}],464:[function(require,module,exports){ arguments[4][40][0].apply(exports,arguments) -},{"_process":342,"dup":40}],471:[function(require,module,exports){ +},{"../../../errors":453,"./end-of-stream":462,"dup":40}],465:[function(require,module,exports){ arguments[4][41][0].apply(exports,arguments) -},{"../../../errors":462,"dup":41}],472:[function(require,module,exports){ +},{"../../../errors":453,"dup":41}],466:[function(require,module,exports){ arguments[4][42][0].apply(exports,arguments) -},{"dup":42}],473:[function(require,module,exports){ +},{"dup":42,"events":193}],467:[function(require,module,exports){ arguments[4][43][0].apply(exports,arguments) -},{"../../../errors":462,"./end-of-stream":471,"dup":43}],474:[function(require,module,exports){ -arguments[4][44][0].apply(exports,arguments) -},{"../../../errors":462,"dup":44}],475:[function(require,module,exports){ -arguments[4][45][0].apply(exports,arguments) -},{"dup":45,"events":196}],476:[function(require,module,exports){ -arguments[4][46][0].apply(exports,arguments) -},{"./lib/_stream_duplex.js":463,"./lib/_stream_passthrough.js":464,"./lib/_stream_readable.js":465,"./lib/_stream_transform.js":466,"./lib/_stream_writable.js":467,"./lib/internal/streams/end-of-stream.js":471,"./lib/internal/streams/pipeline.js":473,"dup":46}],477:[function(require,module,exports){ +},{"./lib/_stream_duplex.js":454,"./lib/_stream_passthrough.js":455,"./lib/_stream_readable.js":456,"./lib/_stream_transform.js":457,"./lib/_stream_writable.js":458,"./lib/internal/streams/end-of-stream.js":462,"./lib/internal/streams/pipeline.js":464,"dup":43}],468:[function(require,module,exports){ /*! stream-to-blob-url. MIT License. Feross Aboukhadijeh */ module.exports = getBlobURL @@ -52314,7 +52910,7 @@ async function getBlobURL (stream, mimeType) { return url } -},{"stream-to-blob":478}],478:[function(require,module,exports){ +},{"stream-to-blob":469}],469:[function(require,module,exports){ /*! stream-to-blob. MIT License. Feross Aboukhadijeh */ /* global Blob */ @@ -52338,7 +52934,7 @@ function streamToBlob (stream, mimeType) { }) } -},{}],479:[function(require,module,exports){ +},{}],470:[function(require,module,exports){ (function (Buffer){(function (){ /*! stream-with-known-length-to-buffer. MIT License. Feross Aboukhadijeh */ var once = require('once') @@ -52357,7 +52953,7 @@ module.exports = function getBuffer (stream, length, cb) { } }).call(this)}).call(this,require("buffer").Buffer) -},{"buffer":116,"once":327}],480:[function(require,module,exports){ +},{"buffer":110,"once":326}],471:[function(require,module,exports){ const { EventEmitter } = require('events') const STREAM_DESTROYED = new Error('Stream was destroyed') const PREMATURE_CLOSE = new Error('Premature close') @@ -52655,8 +53251,8 @@ class ReadableState { if ((stream._duplexState & READ_STATUS) === READ_QUEUED) { const data = this.shift() - if ((stream._duplexState & READ_EMIT_DATA) !== 0) stream.emit('data', data) if (this.pipeTo !== null && this.pipeTo.write(data) === false) stream._duplexState &= READ_PIPE_NOT_DRAINED + if ((stream._duplexState & READ_EMIT_DATA) !== 0) stream.emit('data', data) return data } @@ -52668,8 +53264,8 @@ class ReadableState { while ((stream._duplexState & READ_STATUS) === READ_QUEUED && (stream._duplexState & READ_FLOWING) !== 0) { const data = this.shift() - if ((stream._duplexState & READ_EMIT_DATA) !== 0) stream.emit('data', data) if (this.pipeTo !== null && this.pipeTo.write(data) === false) stream._duplexState &= READ_PIPE_NOT_DRAINED + if ((stream._duplexState & READ_EMIT_DATA) !== 0) stream.emit('data', data) } } @@ -53346,7 +53942,7 @@ module.exports = { PassThrough } -},{"events":196,"fast-fifo":199,"queue-tick":356}],481:[function(require,module,exports){ +},{"events":193,"fast-fifo":196,"queue-tick":355}],472:[function(require,module,exports){ // Copyright Joyent, Inc. and other Node contributors. // // Permission is hereby granted, free of charge, to any person obtaining a @@ -53643,7 +54239,7 @@ function simpleWrite(buf) { function simpleEnd(buf) { return buf && buf.length ? this.write(buf) : ''; } -},{"safe-buffer":386}],482:[function(require,module,exports){ +},{"safe-buffer":383}],473:[function(require,module,exports){ /* Copyright (c) 2011, Chris Umbel @@ -53671,7 +54267,7 @@ var base32 = require('./thirty-two'); exports.encode = base32.encode; exports.decode = base32.decode; -},{"./thirty-two":483}],483:[function(require,module,exports){ +},{"./thirty-two":474}],474:[function(require,module,exports){ (function (Buffer){(function (){ /* Copyright (c) 2011, Chris Umbel @@ -53803,10 +54399,10 @@ exports.decode = function(encoded) { }; }).call(this)}).call(this,require("buffer").Buffer) -},{"buffer":116}],484:[function(require,module,exports){ +},{"buffer":110}],475:[function(require,module,exports){ (function (process){(function (){ /**! -* tippy.js v6.3.1 +* tippy.js v6.3.3 * (c) 2017-2021 atomiks * MIT License */ @@ -53826,6 +54422,9 @@ var TOUCH_OPTIONS = { passive: true, capture: true }; +var TIPPY_DEFAULT_APPEND_TO = function TIPPY_DEFAULT_APPEND_TO() { + return document.body; +}; function hasOwnProperty(obj, key) { return {}.hasOwnProperty.call(obj, key); @@ -53987,6 +54586,26 @@ function updateTransitionEndListener(box, action, listener) { box[method](event, listener); }); } +/** + * Compared to xxx.contains, this function works for dom structures with shadow + * dom + */ + +function actualContains(parent, child) { + var target = child; + + while (target) { + var _ref2; + + if (parent.contains(target)) { + return true; + } + + target = (_ref2 = target.getRootNode == null ? void 0 : target.getRootNode()) == null ? void 0 : _ref2.host; + } + + return false; +} var currentInput = { isTouch: false @@ -54050,8 +54669,8 @@ function bindGlobalEventListeners() { } var isBrowser = typeof window !== 'undefined' && typeof document !== 'undefined'; -var ua = isBrowser ? navigator.userAgent : ''; -var isIE = /MSIE |Trident\//.test(ua); +var isIE11 = isBrowser ? // @ts-ignore +!!window.msCrypto : false; function createMemoryLeakWarning(method) { var txt = method === 'destroy' ? 'n already-' : ' '; @@ -54126,9 +54745,7 @@ var renderProps = { zIndex: 9999 }; var defaultProps = Object.assign({ - appendTo: function appendTo() { - return document.body; - }, + appendTo: TIPPY_DEFAULT_APPEND_TO, aria: { content: 'auto', expanded: 'auto' @@ -54183,7 +54800,9 @@ function getExtendedPassedProps(passedProps) { defaultValue = plugin.defaultValue; if (name) { - acc[name] = passedProps[name] !== undefined ? passedProps[name] : defaultValue; + var _name; + + acc[name] = passedProps[name] !== undefined ? passedProps[name] : (_name = defaultProps[name]) != null ? _name : defaultValue; } return acc; @@ -54608,15 +55227,16 @@ function createTippy(reference, passedProps) { if (didTouchMove || event.type === 'mousedown') { return; } - } // Clicked on interactive popper + } + var actualTarget = event.composedPath && event.composedPath()[0] || event.target; // Clicked on interactive popper - if (instance.props.interactive && popper.contains(event.target)) { + if (instance.props.interactive && actualContains(popper, actualTarget)) { return; } // Clicked on the event listeners target - if (getCurrentTarget().contains(event.target)) { + if (actualContains(getCurrentTarget(), actualTarget)) { if (currentInput.isTouch) { return; } @@ -54744,7 +55364,7 @@ function createTippy(reference, passedProps) { break; case 'focus': - on(isIE ? 'focusout' : 'blur', onBlurOrFocusOut); + on(isIE11 ? 'focusout' : 'blur', onBlurOrFocusOut); break; case 'focusin': @@ -54970,7 +55590,7 @@ function createTippy(reference, passedProps) { var node = getCurrentTarget(); - if (instance.props.interactive && appendTo === defaultProps.appendTo || appendTo === 'parent') { + if (instance.props.interactive && appendTo === TIPPY_DEFAULT_APPEND_TO || appendTo === 'parent') { parentNode = node.parentNode; } else { parentNode = invokeWithArgsOrReturn(appendTo, [node]); @@ -55089,7 +55709,7 @@ function createTippy(reference, passedProps) { invokeHook('onBeforeUpdate', [instance, partialProps]); removeListeners(); var prevProps = instance.props; - var nextProps = evaluateProps(reference, Object.assign({}, instance.props, {}, partialProps, { + var nextProps = evaluateProps(reference, Object.assign({}, prevProps, {}, removeUndefinedProps(partialProps), { ignoreAttributes: true })); instance.props = nextProps; @@ -55583,13 +56203,13 @@ var createSingleton = function createSingleton(tippyInstances, optionalProps) { } // target is a child tippy instance - if (individualInstances.includes(target)) { + if (individualInstances.indexOf(target) >= 0) { var ref = target.reference; return prepareInstance(singleton, ref); } // target is a ReferenceElement - if (references.includes(target)) { + if (references.indexOf(target) >= 0) { return prepareInstance(singleton, target); } }; @@ -55632,7 +56252,7 @@ var createSingleton = function createSingleton(tippyInstances, optionalProps) { individualInstances = nextInstances; enableInstances(false); setReferences(); - interceptSetProps(singleton); + interceptSetPropsCleanups = interceptSetProps(singleton); singleton.setProps({ triggerTarget: references }); @@ -55918,6 +56538,7 @@ var followCursor = { if (isCursorOverReference || !instance.props.interactive) { instance.setProps({ + // @ts-ignore - unneeded DOMRect properties getReferenceClientRect: function getReferenceClientRect() { var rect = reference.getBoundingClientRect(); var x = clientX; @@ -56054,6 +56675,7 @@ var inlinePositioning = { var placement; var cursorRectIndex = -1; var isInternalUpdate = false; + var triedPlacements = []; var modifier = { name: 'tippyInlinePositioning', enabled: true, @@ -56062,8 +56684,14 @@ var inlinePositioning = { var state = _ref2.state; if (isEnabled()) { - if (placement !== state.placement) { + if (triedPlacements.indexOf(state.placement) !== -1) { + triedPlacements = []; + } + + if (placement !== state.placement && triedPlacements.indexOf(state.placement) === -1) { + triedPlacements.push(state.placement); instance.setProps({ + // @ts-ignore - unneeded DOMRect properties getReferenceClientRect: function getReferenceClientRect() { return _getReferenceClientRect(state.placement); } @@ -56100,10 +56728,11 @@ var inlinePositioning = { var cursorRect = rects.find(function (rect) { return rect.left - 2 <= event.clientX && rect.right + 2 >= event.clientX && rect.top - 2 <= event.clientY && rect.bottom + 2 >= event.clientY; }); - cursorRectIndex = rects.indexOf(cursorRect); + var index = rects.indexOf(cursorRect); + cursorRectIndex = index > -1 ? index : cursorRectIndex; } }, - onUntrigger: function onUntrigger() { + onHidden: function onHidden() { cursorRectIndex = -1; } }; @@ -56251,7 +56880,7 @@ exports.sticky = sticky; }).call(this)}).call(this,require('_process')) -},{"@popperjs/core":1,"_process":342}],485:[function(require,module,exports){ +},{"@popperjs/core":1,"_process":341}],476:[function(require,module,exports){ var Buffer = require('buffer').Buffer module.exports = function (buf) { @@ -56280,7 +56909,7 @@ module.exports = function (buf) { } } -},{"buffer":116}],486:[function(require,module,exports){ +},{"buffer":110}],477:[function(require,module,exports){ (function (process){(function (){ /*! torrent-discovery. MIT License. WebTorrent LLC */ const debug = require('debug')('torrent-discovery') @@ -56506,13 +57135,7 @@ class Discovery extends EventEmitter { module.exports = Discovery }).call(this)}).call(this,require('_process')) -},{"_process":342,"bittorrent-dht/client":73,"bittorrent-lsd":73,"bittorrent-tracker/client":47,"debug":487,"events":196,"run-parallel":384}],487:[function(require,module,exports){ -arguments[4][29][0].apply(exports,arguments) -},{"./common":488,"_process":342,"dup":29}],488:[function(require,module,exports){ -arguments[4][30][0].apply(exports,arguments) -},{"dup":30,"ms":489}],489:[function(require,module,exports){ -arguments[4][31][0].apply(exports,arguments) -},{"dup":31}],490:[function(require,module,exports){ +},{"_process":341,"bittorrent-dht/client":67,"bittorrent-lsd":67,"bittorrent-tracker/client":44,"debug":161,"events":193,"run-parallel":381}],478:[function(require,module,exports){ (function (Buffer){(function (){ /*! torrent-piece. MIT License. WebTorrent LLC */ const BLOCK_LENGTH = 1 << 14 @@ -56623,7 +57246,7 @@ Object.defineProperty(Piece, 'BLOCK_LENGTH', { value: BLOCK_LENGTH }) module.exports = Piece }).call(this)}).call(this,require("buffer").Buffer) -},{"buffer":116}],491:[function(require,module,exports){ +},{"buffer":110}],479:[function(require,module,exports){ (function (Buffer){(function (){ /** * Convert a typed array to a Buffer without a copy @@ -56652,7 +57275,7 @@ module.exports = function typedarrayToBuffer (arr) { } }).call(this)}).call(this,require("buffer").Buffer) -},{"buffer":116,"is-typedarray":252}],492:[function(require,module,exports){ +},{"buffer":110,"is-typedarray":249}],480:[function(require,module,exports){ var bufferAlloc = require('buffer-alloc') var UINT_32_MAX = Math.pow(2, 32) @@ -56685,7 +57308,7 @@ exports.decode = function (buf, offset) { exports.encode.bytes = 8 exports.decode.bytes = 8 -},{"buffer-alloc":118}],493:[function(require,module,exports){ +},{"buffer-alloc":112}],481:[function(require,module,exports){ module.exports = remove function remove (arr, i) { @@ -56699,7 +57322,7 @@ function remove (arr, i) { return last } -},{}],494:[function(require,module,exports){ +},{}],482:[function(require,module,exports){ // Copyright Joyent, Inc. and other Node contributors. // // Permission is hereby granted, free of charge, to any person obtaining a @@ -57433,7 +58056,7 @@ Url.prototype.parseHost = function() { if (host) this.hostname = host; }; -},{"./util":495,"punycode":351,"querystring":354}],495:[function(require,module,exports){ +},{"./util":483,"punycode":350,"querystring":353}],483:[function(require,module,exports){ 'use strict'; module.exports = { @@ -57451,7 +58074,7 @@ module.exports = { } }; -},{}],496:[function(require,module,exports){ +},{}],484:[function(require,module,exports){ (function (Buffer){(function (){ /*! ut_metadata. MIT License. WebTorrent LLC */ const { EventEmitter } = require('events') @@ -57699,13 +58322,7 @@ module.exports = metadata => { } }).call(this)}).call(this,require("buffer").Buffer) -},{"bencode":23,"bitfield":27,"buffer":116,"debug":497,"events":196,"simple-sha1":417}],497:[function(require,module,exports){ -arguments[4][29][0].apply(exports,arguments) -},{"./common":498,"_process":342,"dup":29}],498:[function(require,module,exports){ -arguments[4][30][0].apply(exports,arguments) -},{"dup":30,"ms":499}],499:[function(require,module,exports){ -arguments[4][31][0].apply(exports,arguments) -},{"dup":31}],500:[function(require,module,exports){ +},{"bencode":23,"bitfield":27,"buffer":110,"debug":161,"events":193,"simple-sha1":411}],485:[function(require,module,exports){ (function (global){(function (){ /** @@ -57776,7 +58393,7 @@ function config (name) { } }).call(this)}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{}],501:[function(require,module,exports){ +},{}],486:[function(require,module,exports){ (function (Buffer){(function (){ const bs = require('binary-search') const EventEmitter = require('events') @@ -58256,7 +58873,7 @@ const MIN_FRAGMENT_DURATION = 1 // second module.exports = MP4Remuxer }).call(this)}).call(this,require("buffer").Buffer) -},{"binary-search":26,"buffer":116,"events":196,"mp4-box-encoding":291,"mp4-stream":294,"range-slice-stream":360}],502:[function(require,module,exports){ +},{"binary-search":26,"buffer":110,"events":193,"mp4-box-encoding":289,"mp4-stream":292,"range-slice-stream":360}],487:[function(require,module,exports){ const MediaElementWrapper = require('mediasource') const pump = require('pump') @@ -58384,29 +59001,32 @@ VideoStream.prototype = { module.exports = VideoStream -},{"./mp4-remuxer":501,"mediasource":265,"pump":350}],503:[function(require,module,exports){ +},{"./mp4-remuxer":486,"mediasource":259,"pump":349}],488:[function(require,module,exports){ (function (Buffer){(function (){ /*! webtorrent. MIT License. WebTorrent LLC */ -/* global FileList */ +/* global FileList, ServiceWorker */ +/* eslint-env browser */ -const { EventEmitter } = require('events') +const EventEmitter = require('events') +const path = require('path') const concat = require('simple-concat') const createTorrent = require('create-torrent') -const debug = require('debug')('webtorrent') +const debugFactory = require('debug') const DHT = require('bittorrent-dht/client') // browser exclude const loadIPSet = require('load-ip-set') // browser exclude const parallel = require('run-parallel') const parseTorrent = require('parse-torrent') -const path = require('path') const Peer = require('simple-peer') const queueMicrotask = require('queue-microtask') const randombytes = require('randombytes') +const sha1 = require('simple-sha1') const speedometer = require('speedometer') const { ThrottleGroup } = require('speed-limiter') +const ConnPool = require('./lib/conn-pool.js') // browser exclude +const Torrent = require('./lib/torrent.js') +const { version: VERSION } = require('./package.json') -const ConnPool = require('./lib/conn-pool') // browser exclude -const Torrent = require('./lib/torrent') -const VERSION = require('./package.json').version +const debug = debugFactory('webtorrent') /** * Version number in Azureus-style. Generated from major and minor semver version. @@ -58468,6 +59088,14 @@ class WebTorrent extends EventEmitter { this._downloadLimit = Math.max((typeof opts.downloadLimit === 'number') ? opts.downloadLimit : -1, -1) this._uploadLimit = Math.max((typeof opts.uploadLimit === 'number') ? opts.uploadLimit : -1, -1) + this.serviceWorker = null + this.workerKeepAliveInterval = null + this.workerPortCount = 0 + + if (opts.secure === true) { + require('./lib/peer').enableSecure() + } + this._debug( 'new webtorrent (peerId %s, nodeId %s, port %s)', this.peerId, this.nodeId, this.torrentPort @@ -58540,6 +59168,68 @@ class WebTorrent extends EventEmitter { } } + /** + * Accepts an existing service worker registration [navigator.serviceWorker.controller] + * which must be activated, "creates" a file server for streamed file rendering to use. + * + * @param {ServiceWorker} controller + * @param {function=} cb + * @return {null} + */ + loadWorker (controller, cb = () => {}) { + if (!(controller instanceof ServiceWorker)) throw new Error('Invalid worker registration') + if (controller.state !== 'activated') throw new Error('Worker isn\'t activated') + const keepAliveTime = 20000 + + this.serviceWorker = controller + + navigator.serviceWorker.addEventListener('message', event => { + const { data } = event + if (!data.type || !data.type === 'webtorrent' || !data.url) return null + let [infoHash, ...filePath] = data.url.slice(data.url.indexOf(data.scope + 'webtorrent/') + 11 + data.scope.length).split('/') + filePath = decodeURI(filePath.join('/')) + if (!infoHash || !filePath) return null + + const [port] = event.ports + + const file = this.get(infoHash) && this.get(infoHash).files.find(file => file.path === filePath) + if (!file) return null + + const [response, stream, raw] = file._serve(data) + const asyncIterator = stream && stream[Symbol.asyncIterator]() + + const cleanup = () => { + port.onmessage = null + if (stream) stream.destroy() + if (raw) raw.destroy() + this.workerPortCount-- + if (!this.workerPortCount) { + clearInterval(this.workerKeepAliveInterval) + this.workerKeepAliveInterval = null + } + } + + port.onmessage = async msg => { + if (msg.data) { + let chunk + try { + chunk = (await asyncIterator.next()).value + } catch (e) { + // chunk is yet to be downloaded or it somehow failed, should this be logged? + } + port.postMessage(chunk) + if (!chunk) cleanup() + if (!this.workerKeepAliveInterval) this.workerKeepAliveInterval = setInterval(() => fetch(`${this.serviceWorker.scriptURL.substr(0, this.serviceWorker.scriptURL.lastIndexOf('/') + 1).slice(window.location.origin.length)}webtorrent/keepalive/`), keepAliveTime) + } else { + cleanup() + } + } + this.workerPortCount++ + port.postMessage(response) + }) + cb(this.serviceWorker) + } + get downloadSpeed () { return this._downloadSpeed() } get uploadSpeed () { return this._uploadSpeed() } @@ -58740,6 +59430,9 @@ class WebTorrent extends EventEmitter { if (!torrent) return this.torrents.splice(this.torrents.indexOf(torrent), 1) torrent.destroy(opts, cb) + if (this.dht) { + this.dht._tables.remove(torrent.infoHash) + } } address () { @@ -58834,6 +59527,19 @@ class WebTorrent extends EventEmitter { args[0] = `[${this._debugId}] ${args[0]}` debug(...args) } + + _getByHash (infoHashHash) { + for (const torrent of this.torrents) { + if (!torrent.infoHashHash) { + torrent.infoHashHash = sha1.sync(Buffer.from('72657132' /* 'req2' */ + torrent.infoHash, 'hex')) + } + if (infoHashHash === torrent.infoHashHash) { + return torrent + } + } + + return null + } } WebTorrent.WEBRTC_SUPPORT = Peer.WEBRTC_SUPPORT @@ -58861,11 +59567,13 @@ function isFileList (obj) { module.exports = WebTorrent }).call(this)}).call(this,require("buffer").Buffer) -},{"./lib/conn-pool":73,"./lib/torrent":508,"./package.json":528,"bittorrent-dht/client":73,"buffer":116,"create-torrent":149,"debug":510,"events":196,"load-ip-set":73,"parse-torrent":333,"path":334,"queue-microtask":355,"randombytes":358,"run-parallel":384,"simple-concat":396,"simple-peer":398,"speed-limiter":438,"speedometer":442}],504:[function(require,module,exports){ -const debug = require('debug')('webtorrent:file-stream') -const stream = require('readable-stream') +},{"./lib/conn-pool.js":67,"./lib/peer":491,"./lib/torrent.js":493,"./package.json":495,"bittorrent-dht/client":67,"buffer":110,"create-torrent":144,"debug":161,"events":193,"load-ip-set":67,"parse-torrent":332,"path":333,"queue-microtask":354,"randombytes":357,"run-parallel":381,"simple-concat":393,"simple-peer":395,"simple-sha1":411,"speed-limiter":429,"speedometer":433}],489:[function(require,module,exports){ +const stream = require('stream') +const debugFactory = require('debug') const eos = require('end-of-stream') +const debug = debugFactory('webtorrent:file-stream') + /** * Readable stream of a torrent file * @@ -58968,16 +59676,19 @@ class FileStream extends stream.Readable { module.exports = FileStream -},{"debug":510,"end-of-stream":194,"readable-stream":527}],505:[function(require,module,exports){ -const { EventEmitter } = require('events') -const { PassThrough } = require('readable-stream') +},{"debug":161,"end-of-stream":191,"stream":434}],490:[function(require,module,exports){ +const EventEmitter = require('events') +const { PassThrough } = require('stream') const path = require('path') const render = require('render-media') const streamToBlob = require('stream-to-blob') const streamToBlobURL = require('stream-to-blob-url') const streamToBuffer = require('stream-with-known-length-to-buffer') -const FileStream = require('./file-stream') const queueMicrotask = require('queue-microtask') +const rangeParser = require('range-parser') +const mime = require('mime') +const eos = require('end-of-stream') +const FileStream = require('./file-stream.js') class File extends EventEmitter { constructor (torrent, file) { @@ -59004,6 +59715,8 @@ class File extends EventEmitter { this.done = true this.emit('done') } + + this._serviceWorker = torrent.client.serviceWorker } get downloaded () { @@ -59115,6 +59828,77 @@ class File extends EventEmitter { render.render(this, elem, opts, cb) } + _serve (req) { + const res = { + status: 200, + headers: { + // Support range-requests + 'Accept-Ranges': 'bytes', + 'Content-Type': mime.getType(this.name), + 'Cache-Control': 'no-cache, no-store, must-revalidate, max-age=0', + Expires: '0' + }, + body: req.method === 'HEAD' ? '' : 'STREAM' + } + // force the browser to download the file if if it's opened in a new tab + if (req.destination === 'document') { + res.headers['Content-Type'] = 'application/octet-stream' + res.headers['Content-Disposition'] = 'attachment' + res.body = 'DOWNLOAD' + } + + // `rangeParser` returns an array of ranges, or an error code (number) if + // there was an error parsing the range. + let range = rangeParser(this.length, req.headers.range || '') + + if (range.constructor === Array) { + res.status = 206 // indicates that range-request was understood + + // no support for multi-range request, just use the first range + range = range[0] + + res.headers['Content-Range'] = `bytes ${range.start}-${range.end}/${this.length}` + res.headers['Content-Length'] = `${range.end - range.start + 1}` + } else { + res.headers['Content-Length'] = this.length + } + + const stream = req.method === 'GET' && this.createReadStream(range) + + let pipe = null + if (stream) { + this.emit('stream', { stream, req, file: this }, piped => { + pipe = piped + + // piped stream might not close the original filestream on close/error, this is agressive but necessary + eos(piped, () => { + if (piped) piped.destroy() + stream.destroy() + }) + }) + } + + return [res, pipe || stream, pipe && stream] + } + + getStreamURL (cb = () => {}) { + if (typeof window === 'undefined') throw new Error('browser-only method') + if (!this._serviceWorker) throw new Error('No worker registered') + if (this._serviceWorker.state !== 'activated') throw new Error('Worker isn\'t activated') + const workerPath = this._serviceWorker.scriptURL.substr(0, this._serviceWorker.scriptURL.lastIndexOf('/') + 1).slice(window.location.origin.length) + const url = `${workerPath}webtorrent/${this._torrent.infoHash}/${encodeURI(this.path)}` + cb(null, url) + } + + streamTo (elem, cb = () => {}) { + if (typeof window === 'undefined') throw new Error('browser-only method') + if (!this._serviceWorker) throw new Error('No worker registered') + if (this._serviceWorker.state !== 'activated') throw new Error('Worker isn\'t activated') + const workerPath = this._serviceWorker.scriptURL.substr(0, this._serviceWorker.scriptURL.lastIndexOf('/') + 1).slice(window.location.origin.length) + elem.src = `${workerPath}webtorrent/${this._torrent.infoHash}/${encodeURI(this.path)}` + cb(null, elem) + } + _getMimeType () { return render.mime[path.extname(this.name).toLowerCase()] } @@ -59132,17 +59916,24 @@ class File extends EventEmitter { module.exports = File -},{"./file-stream":504,"events":196,"path":334,"queue-microtask":355,"readable-stream":527,"render-media":377,"stream-to-blob":478,"stream-to-blob-url":477,"stream-with-known-length-to-buffer":479}],506:[function(require,module,exports){ -const { EventEmitter } = require('events') +},{"./file-stream.js":489,"end-of-stream":191,"events":193,"mime":282,"path":333,"queue-microtask":354,"range-parser":359,"render-media":377,"stream":434,"stream-to-blob":469,"stream-to-blob-url":468,"stream-with-known-length-to-buffer":470}],491:[function(require,module,exports){ +const EventEmitter = require('events') const { Transform } = require('stream') const arrayRemove = require('unordered-array-remove') -const debug = require('debug')('webtorrent:peer') +const debugFactory = require('debug') const Wire = require('bittorrent-protocol') const CONNECT_TIMEOUT_TCP = 5000 const CONNECT_TIMEOUT_UTP = 5000 const CONNECT_TIMEOUT_WEBRTC = 25000 const HANDSHAKE_TIMEOUT = 25000 +const debug = debugFactory('webtorrent:peer') + +let secure = false + +exports.enableSecure = () => { + secure = true +} /** * WebRTC peer connections start out connected, because WebRTC peers require an @@ -59272,6 +60063,10 @@ class Peer extends EventEmitter { this.timeout = null // handshake timeout this.retries = 0 // outgoing TCP connection retry count + this.sentPe1 = false + this.sentPe2 = false + this.sentPe3 = false + this.sentPe4 = false this.sentHandshake = false } @@ -59301,8 +60096,8 @@ class Peer extends EventEmitter { this.destroy(err) }) - const wire = this.wire = new Wire() - wire.type = this.type + const wire = this.wire = new Wire(this.type, this.retries, secure) + wire.once('end', () => { this.destroy() }) @@ -59316,6 +60111,18 @@ class Peer extends EventEmitter { this.destroy(err) }) + wire.once('pe1', () => { + this.onPe1() + }) + wire.once('pe2', () => { + this.onPe2() + }) + wire.once('pe3', () => { + this.onPe3() + }) + wire.once('pe4', () => { + this.onPe4() + }) wire.once('handshake', (infoHash, peerId) => { this.onHandshake(infoHash, peerId) }) @@ -59323,7 +60130,53 @@ class Peer extends EventEmitter { this.setThrottlePipes() - if (this.swarm && !this.sentHandshake) this.handshake() + if (this.swarm) { + if (this.type === 'tcpOutgoing') { + if (secure && this.retries === 0 && !this.sentPe1) this.sendPe1() + else if (!this.sentHandshake) this.handshake() + } else if (this.type !== 'tcpIncoming' && !this.sentHandshake) this.handshake() + } + } + + sendPe1 () { + this.wire.sendPe1() + this.sentPe1 = true + } + + onPe1 () { + this.sendPe2() + } + + sendPe2 () { + this.wire.sendPe2() + this.sentPe2 = true + } + + onPe2 () { + this.sendPe3() + } + + sendPe3 () { + this.wire.sendPe3(this.swarm.infoHash) + this.sentPe3 = true + } + + onPe3 (infoHashHash) { + if (this.swarm) { + if (this.swarm.infoHashHash !== infoHashHash) { + this.destroy(new Error('unexpected crypto handshake info hash for this swarm')) + } + this.sendPe4() + } + } + + sendPe4 () { + this.wire.sendPe4(this.swarm.infoHash) + this.sentPe4 = true + } + + onPe4 () { + if (!this.sentHandshake) this.handshake() } clearPipes () { @@ -59452,7 +60305,7 @@ class Peer extends EventEmitter { } } -},{"bittorrent-protocol":28,"debug":510,"events":196,"stream":443,"unordered-array-remove":493}],507:[function(require,module,exports){ +},{"bittorrent-protocol":28,"debug":161,"events":193,"stream":434,"unordered-array-remove":481}],492:[function(require,module,exports){ /** * Mapping of torrent pieces to their respective availability in the torrent swarm. Used @@ -59562,31 +60415,31 @@ class RarityMap { module.exports = RarityMap -},{}],508:[function(require,module,exports){ +},{}],493:[function(require,module,exports){ (function (process,global){(function (){ /* global Blob */ +const EventEmitter = require('events') +const fs = require('fs') +const net = require('net') // browser exclude +const os = require('os') // browser exclude +const path = require('path') const addrToIPPort = require('addr-to-ip-port') -const BitField = require('bitfield').default +const { default: BitField } = require('bitfield') const CacheChunkStore = require('cache-chunk-store') const ChunkStoreWriteStream = require('chunk-store-stream/write') const cpus = require('cpus') -const debug = require('debug')('webtorrent:torrent') +const debugFactory = require('debug') const Discovery = require('torrent-discovery') -const EventEmitter = require('events').EventEmitter -const fs = require('fs') const FSChunkStore = require('fs-chunk-store') // browser: `memory-chunk-store` const get = require('simple-get') const ImmediateChunkStore = require('immediate-chunk-store') const ltDontHave = require('lt_donthave') const MemoryChunkStore = require('memory-chunk-store') const MultiStream = require('multistream') -const net = require('net') // browser exclude -const os = require('os') // browser exclude const parallel = require('run-parallel') const parallelLimit = require('run-parallel-limit') const parseTorrent = require('parse-torrent') -const path = require('path') const Piece = require('torrent-piece') const pump = require('pump') const queueMicrotask = require('queue-microtask') @@ -59596,13 +60449,14 @@ const speedometer = require('speedometer') const utMetadata = require('ut_metadata') const utPex = require('ut_pex') // browser exclude -const File = require('./file') -const Peer = require('./peer') -const RarityMap = require('./rarity-map') -const Server = require('./server') // browser exclude -const utp = require('./utp') // browser exclude -const WebConn = require('./webconn') +const File = require('./file.js') +const Peer = require('./peer.js') +const RarityMap = require('./rarity-map.js') +const Server = require('./server.js') // browser exclude +const utp = require('./utp.js') // browser exclude +const WebConn = require('./webconn.js') +const debug = debugFactory('webtorrent:torrent') const MAX_BLOCK_LENGTH = 128 * 1024 const PIECE_TIMEOUT = 30000 const CHOKE_TIMEOUT = 5000 @@ -59639,7 +60493,8 @@ class Torrent extends EventEmitter { this.announce = opts.announce this.urlList = opts.urlList - this.path = opts.path + this.path = opts.path || TMP + this.addUID = opts.addUID || false this.skipVerify = !!opts.skipVerify this._store = opts.store || FSChunkStore this._preloadedStore = opts.preloadedStore || null @@ -59668,6 +60523,7 @@ class Torrent extends EventEmitter { this.metadata = null this.store = null + this.storeOpts = opts.storeOpts this.files = [] this.pieces = [] @@ -59795,8 +60651,6 @@ class Torrent extends EventEmitter { return this._destroy(new Error('Malformed torrent data: No info hash')) } - if (!this.path) this.path = path.join(TMP, this.infoHash) - this._rechokeIntervalId = setInterval(() => { this._rechoke() }, RECHOKE_INTERVAL) @@ -60039,21 +60893,18 @@ class Torrent extends EventEmitter { this._rarityMap = new RarityMap(this) + this.files = this.files.map(file => new File(this, file)) + let rawStore = this._preloadedStore if (!rawStore) { rawStore = new this._store(this.pieceLength, { - // opts.torrent is deprecated (replaced by the name property). - // it doesn't appear to be used by current versions of any stores on npm. - torrent: { - infoHash: this.infoHash - }, - files: this.files.map(file => ({ - path: path.join(this.path, file.path), - length: file.length, - offset: file.offset - })), + ...this.storeOpts, + torrent: this, + path: this.path, + files: this.files, length: this.length, - name: this.infoHash + name: this.name + ' - ' + this.infoHash.slice(0, 8), + addUID: this.addUID }) } @@ -60068,8 +60919,6 @@ class Torrent extends EventEmitter { rawStore ) - this.files = this.files.map(file => new File(this, file)) - // Select only specified files (BEP53) http://www.bittorrent.org/beps/bep_0053.html if (this.so) { this.files.forEach((v, i) => { @@ -60153,7 +61002,8 @@ class Torrent extends EventEmitter { getFileModtimes (cb) { const ret = [] parallelLimit(this.files.map((file, index) => cb => { - fs.stat(path.join(this.path, file.path), (err, stat) => { + const filePath = this.addUID ? path.join(this.name + ' - ' + this.infoHash.slice(0, 8)) : path.join(this.path, file.path) + fs.stat(filePath, (err, stat) => { if (err && err.code !== 'ENOENT') return cb(err) ret[index] = stat && stat.mtime.getTime() cb(null) @@ -61263,6 +62113,8 @@ class Torrent extends EventEmitter { this.done = true this._debug(`torrent done: ${this.infoHash}`) this.emit('done') + } else { + this.done = false } this._gcSelections() @@ -61434,15 +62286,16 @@ function noop () {} module.exports = Torrent }).call(this)}).call(this,require('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{"../package.json":528,"./file":505,"./peer":506,"./rarity-map":507,"./server":73,"./utp":73,"./webconn":509,"_process":342,"addr-to-ip-port":3,"bitfield":27,"cache-chunk-store":123,"chunk-store-stream/write":139,"cpus":142,"debug":510,"events":196,"fs":73,"fs-chunk-store":281,"immediate-chunk-store":248,"lt_donthave":259,"memory-chunk-store":281,"multistream":310,"net":73,"os":73,"parse-torrent":333,"path":334,"pump":350,"queue-microtask":355,"random-iterate":357,"run-parallel":384,"run-parallel-limit":383,"simple-get":397,"simple-sha1":417,"speedometer":442,"torrent-discovery":486,"torrent-piece":490,"ut_metadata":496,"ut_pex":73}],509:[function(require,module,exports){ +},{"../package.json":495,"./file.js":490,"./peer.js":491,"./rarity-map.js":492,"./server.js":67,"./utp.js":67,"./webconn.js":494,"_process":341,"addr-to-ip-port":3,"bitfield":27,"cache-chunk-store":117,"chunk-store-stream/write":133,"cpus":137,"debug":161,"events":193,"fs":67,"fs-chunk-store":275,"immediate-chunk-store":245,"lt_donthave":256,"memory-chunk-store":275,"multistream":309,"net":67,"os":67,"parse-torrent":332,"path":333,"pump":349,"queue-microtask":354,"random-iterate":356,"run-parallel":381,"run-parallel-limit":380,"simple-get":394,"simple-sha1":411,"speedometer":433,"torrent-discovery":477,"torrent-piece":478,"ut_metadata":484,"ut_pex":67}],494:[function(require,module,exports){ (function (Buffer){(function (){ -const BitField = require('bitfield').default -const debug = require('debug')('webtorrent:webconn') +const { default: BitField } = require('bitfield') +const debugFactory = require('debug') const get = require('simple-get') const ltDontHave = require('lt_donthave') const sha1 = require('simple-sha1') const Wire = require('bittorrent-protocol') +const debug = debugFactory('webtorrent:webconn') const VERSION = require('../package.json').version const SOCKET_TIMEOUT = 60000 @@ -61654,47 +62507,11 @@ class WebConn extends Wire { module.exports = WebConn }).call(this)}).call(this,require("buffer").Buffer) -},{"../package.json":528,"bitfield":27,"bittorrent-protocol":28,"buffer":116,"debug":510,"lt_donthave":259,"simple-get":397,"simple-sha1":417}],510:[function(require,module,exports){ -arguments[4][29][0].apply(exports,arguments) -},{"./common":511,"_process":342,"dup":29}],511:[function(require,module,exports){ -arguments[4][30][0].apply(exports,arguments) -},{"dup":30,"ms":512}],512:[function(require,module,exports){ -arguments[4][31][0].apply(exports,arguments) -},{"dup":31}],513:[function(require,module,exports){ -arguments[4][32][0].apply(exports,arguments) -},{"dup":32}],514:[function(require,module,exports){ -arguments[4][33][0].apply(exports,arguments) -},{"./_stream_readable":516,"./_stream_writable":518,"_process":342,"dup":33,"inherits":249}],515:[function(require,module,exports){ -arguments[4][34][0].apply(exports,arguments) -},{"./_stream_transform":517,"dup":34,"inherits":249}],516:[function(require,module,exports){ -arguments[4][35][0].apply(exports,arguments) -},{"../errors":513,"./_stream_duplex":514,"./internal/streams/async_iterator":519,"./internal/streams/buffer_list":520,"./internal/streams/destroy":521,"./internal/streams/from":523,"./internal/streams/state":525,"./internal/streams/stream":526,"_process":342,"buffer":116,"dup":35,"events":196,"inherits":249,"string_decoder/":481,"util":73}],517:[function(require,module,exports){ -arguments[4][36][0].apply(exports,arguments) -},{"../errors":513,"./_stream_duplex":514,"dup":36,"inherits":249}],518:[function(require,module,exports){ -arguments[4][37][0].apply(exports,arguments) -},{"../errors":513,"./_stream_duplex":514,"./internal/streams/destroy":521,"./internal/streams/state":525,"./internal/streams/stream":526,"_process":342,"buffer":116,"dup":37,"inherits":249,"util-deprecate":500}],519:[function(require,module,exports){ -arguments[4][38][0].apply(exports,arguments) -},{"./end-of-stream":522,"_process":342,"dup":38}],520:[function(require,module,exports){ -arguments[4][39][0].apply(exports,arguments) -},{"buffer":116,"dup":39,"util":73}],521:[function(require,module,exports){ -arguments[4][40][0].apply(exports,arguments) -},{"_process":342,"dup":40}],522:[function(require,module,exports){ -arguments[4][41][0].apply(exports,arguments) -},{"../../../errors":513,"dup":41}],523:[function(require,module,exports){ -arguments[4][42][0].apply(exports,arguments) -},{"dup":42}],524:[function(require,module,exports){ -arguments[4][43][0].apply(exports,arguments) -},{"../../../errors":513,"./end-of-stream":522,"dup":43}],525:[function(require,module,exports){ -arguments[4][44][0].apply(exports,arguments) -},{"../../../errors":513,"dup":44}],526:[function(require,module,exports){ -arguments[4][45][0].apply(exports,arguments) -},{"dup":45,"events":196}],527:[function(require,module,exports){ -arguments[4][46][0].apply(exports,arguments) -},{"./lib/_stream_duplex.js":514,"./lib/_stream_passthrough.js":515,"./lib/_stream_readable.js":516,"./lib/_stream_transform.js":517,"./lib/_stream_writable.js":518,"./lib/internal/streams/end-of-stream.js":522,"./lib/internal/streams/pipeline.js":524,"dup":46}],528:[function(require,module,exports){ +},{"../package.json":495,"bitfield":27,"bittorrent-protocol":28,"buffer":110,"debug":161,"lt_donthave":256,"simple-get":394,"simple-sha1":411}],495:[function(require,module,exports){ module.exports={ - "version": "1.3.10" + "version": "1.5.8" } -},{}],529:[function(require,module,exports){ +},{}],496:[function(require,module,exports){ // Returns a wrapper function that returns a wrapped callback // The wrapper function should do some stuff, and return a // presumably different callback function. @@ -61729,7 +62546,7 @@ function wrappy (fn, cb) { } } -},{}],530:[function(require,module,exports){ +},{}],497:[function(require,module,exports){ module.exports = extend var hasOwnProperty = Object.prototype.hasOwnProperty; @@ -61750,7 +62567,7 @@ function extend() { return target } -},{}],531:[function(require,module,exports){ +},{}],498:[function(require,module,exports){ const clipboard = require('clipboard'); const parser = require('parse-torrent'); const Buffer = require('Buffer'); @@ -62291,4 +63108,4 @@ function saveTorrent() { "content_id": parsed.name }); } -},{"Buffer":2,"bytes":122,"clipboard":141,"mime-types":286,"parse-torrent":333,"tippy.js":484,"webtorrent":503}]},{},[531]); +},{"Buffer":2,"bytes":116,"clipboard":135,"mime-types":280,"parse-torrent":332,"tippy.js":475,"webtorrent":488}]},{},[498]); diff --git a/bin/bundle.min.js b/bin/bundle.min.js index 2770346..8f001cd 100644 --- a/bin/bundle.min.js +++ b/bin/bundle.min.js @@ -1,102 +1,109 @@ -!function e(t,n,i){function r(o,a){if(!n[o]){if(!t[o]){var c="function"==typeof require&&require;if(!a&&c)return c(o,!0);if(s)return s(o,!0);var u=new Error("Cannot find module '"+o+"'");throw u.code="MODULE_NOT_FOUND",u}var l=n[o]={exports:{}};t[o][0].call(l.exports,(function(e){return r(t[o][1][e]||e)}),l,l.exports,e,t,n,i)}return n[o].exports}for(var s="function"==typeof require&&require,o=0;o=0?e.ownerDocument.body:r(e)&&p(e)?e:g(b(e))}function v(e,n){var i;void 0===n&&(n=[]);var r=g(e),s=r===(null==(i=e.ownerDocument)?void 0:i.body),o=t(r),a=s?[o].concat(o.visualViewport||[],p(r)?r:[]):r,c=n.concat(a);return s?c:c.concat(v(b(a)))}function y(e){return["table","td","th"].indexOf(u(e))>=0}function _(e){return r(e)&&"fixed"!==f(e).position?e.offsetParent:null}function w(e){for(var n=t(e),i=_(e);i&&y(i)&&"static"===f(i).position;)i=_(i);return i&&("html"===u(i)||"body"===u(i)&&"static"===f(i).position)?n:i||function(e){var t=-1!==navigator.userAgent.toLowerCase().indexOf("firefox");if(-1!==navigator.userAgent.indexOf("Trident")&&r(e)&&"fixed"===f(e).position)return null;for(var n=b(e);r(n)&&["html","body"].indexOf(u(n))<0;){var i=f(n);if("none"!==i.transform||"none"!==i.perspective||"paint"===i.contain||-1!==["transform","perspective"].indexOf(i.willChange)||t&&"filter"===i.willChange||t&&i.filter&&"none"!==i.filter)return n;n=n.parentNode}return null}(e)||n}var x="top",k="bottom",E="right",S="left",M="auto",A=[x,k,E,S],I="start",T="end",j="viewport",C="popper",B=A.reduce((function(e,t){return e.concat([t+"-"+I,t+"-"+T])}),[]),R=[].concat(A,[M]).reduce((function(e,t){return e.concat([t,t+"-"+I,t+"-"+T])}),[]),L=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function O(e){var t=new Map,n=new Set,i=[];function r(e){n.add(e.name),[].concat(e.requires||[],e.requiresIfExists||[]).forEach((function(e){if(!n.has(e)){var i=t.get(e);i&&r(i)}})),i.push(e)}return e.forEach((function(e){t.set(e.name,e)})),e.forEach((function(e){n.has(e.name)||r(e)})),i}function P(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i=0&&r(e)?w(e):e;return i(n)?t.filter((function(e){return i(e)&&F(e,n)&&"body"!==u(e)})):[]}(e):[].concat(t),o=[].concat(s,[n]),a=o[0],c=o.reduce((function(t,n){var i=V(e,n);return t.top=D(i.top,t.top),t.right=z(i.right,t.right),t.bottom=z(i.bottom,t.bottom),t.left=D(i.left,t.left),t}),V(e,a));return c.width=c.right-c.left,c.height=c.bottom-c.top,c.x=c.left,c.y=c.top,c}function $(e){return e.split("-")[1]}function G(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function X(e){var t,n=e.reference,i=e.element,r=e.placement,s=r?N(r):null,o=r?$(r):null,a=n.x+n.width/2-i.width/2,c=n.y+n.height/2-i.height/2;switch(s){case x:t={x:a,y:n.y-i.height};break;case k:t={x:a,y:n.y+n.height};break;case E:t={x:n.x+n.width,y:c};break;case S:t={x:n.x-i.width,y:c};break;default:t={x:n.x,y:n.y}}var u=s?G(s):null;if(null!=u){var l="y"===u?"height":"width";switch(o){case I:t[u]=t[u]-(n[l]/2-i[l]/2);break;case T:t[u]=t[u]+(n[l]/2-i[l]/2)}}return t}function Y(e){return Object.assign({},{top:0,right:0,bottom:0,left:0},e)}function Z(e,t){return t.reduce((function(t,n){return t[n]=e,t}),{})}function J(e,t){void 0===t&&(t={});var n=t,r=n.placement,s=void 0===r?e.placement:r,o=n.boundary,c=void 0===o?"clippingParents":o,u=n.rootBoundary,d=void 0===u?j:u,f=n.elementContext,p=void 0===f?C:f,h=n.altBoundary,m=void 0!==h&&h,b=n.padding,g=void 0===b?0:b,v=Y("number"!=typeof g?g:Z(g,A)),y=p===C?"reference":C,_=e.elements.reference,w=e.rects.popper,S=e.elements[m?y:p],M=K(i(S)?S:S.contextElement||l(e.elements.popper),c,d),I=a(_),T=X({reference:I,element:w,strategy:"absolute",placement:s}),B=W(Object.assign({},w,T)),R=p===C?B:I,L={top:M.top-R.top+v.top,bottom:R.bottom-M.bottom+v.bottom,left:M.left-R.left+v.left,right:R.right-M.right+v.right},O=e.modifiersData.offset;if(p===C&&O){var P=O[s];Object.keys(L).forEach((function(e){var t=[E,k].indexOf(e)>=0?1:-1,n=[x,k].indexOf(e)>=0?"y":"x";L[e]+=P[n]*t}))}return L}var Q="Popper: Invalid reference or popper argument provided. They must be either a DOM element or virtual element.",ee={placement:"bottom",modifiers:[],strategy:"absolute"};function te(){for(var e=arguments.length,t=new Array(e),n=0;n100){console.error("Popper: An infinite loop in the modifiers cycle has been detected! The cycle has been interrupted to prevent a browser crash.");break}if(!0!==u.reset){var o=u.orderedModifiers[s],a=o.fn,c=o.options,l=void 0===c?{}:c,f=o.name;"function"==typeof a&&(u=a({state:u,options:l,name:f,instance:p})||u)}else u.reset=!1,s=-1}}else"production"!==e.env.NODE_ENV&&console.error(Q)}},update:(o=function(){return new Promise((function(e){p.forceUpdate(),e(u)}))},function(){return c||(c=new Promise((function(e){Promise.resolve().then((function(){c=void 0,e(o())}))}))),c}),destroy:function(){b(),d=!0}};if(!te(t,n))return"production"!==e.env.NODE_ENV&&console.error(Q),p;function b(){l.forEach((function(e){return e()})),l=[]}return p.setOptions(r).then((function(e){!d&&r.onFirstUpdate&&r.onFirstUpdate(e)})),p}}var ie={passive:!0};var re={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(e){var n=e.state,i=e.instance,r=e.options,s=r.scroll,o=void 0===s||s,a=r.resize,c=void 0===a||a,u=t(n.elements.popper),l=[].concat(n.scrollParents.reference,n.scrollParents.popper);return o&&l.forEach((function(e){e.addEventListener("scroll",i.update,ie)})),c&&u.addEventListener("resize",i.update,ie),function(){o&&l.forEach((function(e){e.removeEventListener("scroll",i.update,ie)})),c&&u.removeEventListener("resize",i.update,ie)}},data:{}};var se={name:"popperOffsets",enabled:!0,phase:"read",fn:function(e){var t=e.state,n=e.name;t.modifiersData[n]=X({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})},data:{}},oe={top:"auto",right:"auto",bottom:"auto",left:"auto"};function ae(e){var n,i=e.popper,r=e.popperRect,s=e.placement,o=e.offsets,a=e.position,c=e.gpuAcceleration,u=e.adaptive,d=e.roundOffsets,p=!0===d?function(e){var t=e.x,n=e.y,i=window.devicePixelRatio||1;return{x:H(H(t*i)/i)||0,y:H(H(n*i)/i)||0}}(o):"function"==typeof d?d(o):o,h=p.x,m=void 0===h?0:h,b=p.y,g=void 0===b?0:b,v=o.hasOwnProperty("x"),y=o.hasOwnProperty("y"),_=S,M=x,A=window;if(u){var I=w(i),T="clientHeight",j="clientWidth";I===t(i)&&"static"!==f(I=l(i)).position&&(T="scrollHeight",j="scrollWidth"),I=I,s===x&&(M=k,g-=I[T]-r.height,g*=c?1:-1),s===S&&(_=E,m-=I[j]-r.width,m*=c?1:-1)}var C,B=Object.assign({position:a},u&&oe);return c?Object.assign({},B,((C={})[M]=y?"0":"",C[_]=v?"0":"",C.transform=(A.devicePixelRatio||1)<2?"translate("+m+"px, "+g+"px)":"translate3d("+m+"px, "+g+"px, 0)",C)):Object.assign({},B,((n={})[M]=y?g+"px":"",n[_]=v?m+"px":"",n.transform="",n))}var ce={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(t){var n=t.state,i=t.options,r=i.gpuAcceleration,s=void 0===r||r,o=i.adaptive,a=void 0===o||o,c=i.roundOffsets,u=void 0===c||c;if("production"!==e.env.NODE_ENV){var l=f(n.elements.popper).transitionProperty||"";a&&["transform","top","right","bottom","left"].some((function(e){return l.indexOf(e)>=0}))&&console.warn(["Popper: Detected CSS transitions on at least one of the following",'CSS properties: "transform", "top", "right", "bottom", "left".',"\n\n",'Disable the "computeStyles" modifier\'s `adaptive` option to allow',"for smooth transitions, or remove these properties from the CSS","transition declaration on the popper element if only transitioning","opacity or background-color for example.","\n\n","We recommend using the popper element as a wrapper around an inner","element that can have any CSS property transitioned for animations."].join(" "))}var d={placement:N(n.placement),popper:n.elements.popper,popperRect:n.rects.popper,gpuAcceleration:s};null!=n.modifiersData.popperOffsets&&(n.styles.popper=Object.assign({},n.styles.popper,ae(Object.assign({},d,{offsets:n.modifiersData.popperOffsets,position:n.options.strategy,adaptive:a,roundOffsets:u})))),null!=n.modifiersData.arrow&&(n.styles.arrow=Object.assign({},n.styles.arrow,ae(Object.assign({},d,{offsets:n.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:u})))),n.attributes.popper=Object.assign({},n.attributes.popper,{"data-popper-placement":n.placement})},data:{}};var ue={name:"applyStyles",enabled:!0,phase:"write",fn:function(e){var t=e.state;Object.keys(t.elements).forEach((function(e){var n=t.styles[e]||{},i=t.attributes[e]||{},s=t.elements[e];r(s)&&u(s)&&(Object.assign(s.style,n),Object.keys(i).forEach((function(e){var t=i[e];!1===t?s.removeAttribute(e):s.setAttribute(e,!0===t?"":t)})))}))},effect:function(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach((function(e){var i=t.elements[e],s=t.attributes[e]||{},o=Object.keys(t.styles.hasOwnProperty(e)?t.styles[e]:n[e]).reduce((function(e,t){return e[t]="",e}),{});r(i)&&u(i)&&(Object.assign(i.style,o),Object.keys(s).forEach((function(e){i.removeAttribute(e)})))}))}},requires:["computeStyles"]};var le={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(e){var t=e.state,n=e.options,i=e.name,r=n.offset,s=void 0===r?[0,0]:r,o=R.reduce((function(e,n){return e[n]=function(e,t,n){var i=N(e),r=[S,x].indexOf(i)>=0?-1:1,s="function"==typeof n?n(Object.assign({},t,{placement:e})):n,o=s[0],a=s[1];return o=o||0,a=(a||0)*r,[S,E].indexOf(i)>=0?{x:a,y:o}:{x:o,y:a}}(n,t.rects,s),e}),{}),a=o[t.placement],c=a.x,u=a.y;null!=t.modifiersData.popperOffsets&&(t.modifiersData.popperOffsets.x+=c,t.modifiersData.popperOffsets.y+=u),t.modifiersData[i]=o}},de={left:"right",right:"left",bottom:"top",top:"bottom"};function fe(e){return e.replace(/left|right|bottom|top/g,(function(e){return de[e]}))}var pe={start:"end",end:"start"};function he(e){return e.replace(/start|end/g,(function(e){return pe[e]}))}function me(t,n){void 0===n&&(n={});var i=n,r=i.placement,s=i.boundary,o=i.rootBoundary,a=i.padding,c=i.flipVariations,u=i.allowedAutoPlacements,l=void 0===u?R:u,d=$(r),f=d?c?B:B.filter((function(e){return $(e)===d})):A,p=f.filter((function(e){return l.indexOf(e)>=0}));0===p.length&&(p=f,"production"!==e.env.NODE_ENV&&console.error(["Popper: The `allowedAutoPlacements` option did not allow any","placements. Ensure the `placement` option matches the variation","of the allowed placements.",'For example, "auto" cannot be used to allow "bottom-start".','Use "auto-start" instead.'].join(" ")));var h=p.reduce((function(e,n){return e[n]=J(t,{placement:n,boundary:s,rootBoundary:o,padding:a})[N(n)],e}),{});return Object.keys(h).sort((function(e,t){return h[e]-h[t]}))}var be={name:"flip",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,i=e.name;if(!t.modifiersData[i]._skip){for(var r=n.mainAxis,s=void 0===r||r,o=n.altAxis,a=void 0===o||o,c=n.fallbackPlacements,u=n.padding,l=n.boundary,d=n.rootBoundary,f=n.altBoundary,p=n.flipVariations,h=void 0===p||p,m=n.allowedAutoPlacements,b=t.options.placement,g=N(b),v=c||(g===b||!h?[fe(b)]:function(e){if(N(e)===M)return[];var t=fe(e);return[he(e),t,he(t)]}(b)),y=[b].concat(v).reduce((function(e,n){return e.concat(N(n)===M?me(t,{placement:n,boundary:l,rootBoundary:d,padding:u,flipVariations:h,allowedAutoPlacements:m}):n)}),[]),_=t.rects.reference,w=t.rects.popper,A=new Map,T=!0,j=y[0],C=0;C=0,P=O?"width":"height",U=J(t,{placement:B,boundary:l,rootBoundary:d,altBoundary:f,padding:u}),q=O?L?E:S:L?k:x;_[P]>w[P]&&(q=fe(q));var D=fe(q),z=[];if(s&&z.push(U[R]<=0),a&&z.push(U[q]<=0,U[D]<=0),z.every((function(e){return e}))){j=B,T=!1;break}A.set(B,z)}if(T)for(var H=function(e){var t=y.find((function(t){var n=A.get(t);if(n)return n.slice(0,e).every((function(e){return e}))}));if(t)return j=t,"break"},F=h?3:1;F>0;F--){if("break"===H(F))break}t.placement!==j&&(t.modifiersData[i]._skip=!0,t.placement=j,t.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}};function ge(e,t,n){return D(e,z(t,n))}var ve={name:"preventOverflow",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,i=e.name,r=n.mainAxis,s=void 0===r||r,o=n.altAxis,a=void 0!==o&&o,c=n.boundary,u=n.rootBoundary,l=n.altBoundary,d=n.padding,f=n.tether,p=void 0===f||f,h=n.tetherOffset,b=void 0===h?0:h,g=J(t,{boundary:c,rootBoundary:u,padding:d,altBoundary:l}),v=N(t.placement),y=$(t.placement),_=!y,M=G(v),A="x"===M?"y":"x",T=t.modifiersData.popperOffsets,j=t.rects.reference,C=t.rects.popper,B="function"==typeof b?b(Object.assign({},t.rects,{placement:t.placement})):b,R={x:0,y:0};if(T){if(s||a){var L="y"===M?x:S,O="y"===M?k:E,P="y"===M?"height":"width",U=T[M],q=T[M]+g[L],H=T[M]-g[O],F=p?-C[P]/2:0,W=y===I?j[P]:C[P],V=y===I?-C[P]:-j[P],K=t.elements.arrow,X=p&&K?m(K):{width:0,height:0},Y=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},Z=Y[L],Q=Y[O],ee=ge(0,j[P],X[P]),te=_?j[P]/2-F-ee-Z-B:W-ee-Z-B,ne=_?-j[P]/2+F+ee+Q+B:V+ee+Q+B,ie=t.elements.arrow&&w(t.elements.arrow),re=ie?"y"===M?ie.clientTop||0:ie.clientLeft||0:0,se=t.modifiersData.offset?t.modifiersData.offset[t.placement][M]:0,oe=T[M]+te-se-re,ae=T[M]+ne-se;if(s){var ce=ge(p?z(q,oe):q,U,p?D(H,ae):H);T[M]=ce,R[M]=ce-U}if(a){var ue="x"===M?x:S,le="x"===M?k:E,de=T[A],fe=de+g[ue],pe=de-g[le],he=ge(p?z(fe,oe):fe,de,p?D(pe,ae):pe);T[A]=he,R[A]=he-de}}t.modifiersData[i]=R}},requiresIfExists:["offset"]};var ye={name:"arrow",enabled:!0,phase:"main",fn:function(e){var t,n=e.state,i=e.name,r=e.options,s=n.elements.arrow,o=n.modifiersData.popperOffsets,a=N(n.placement),c=G(a),u=[S,E].indexOf(a)>=0?"height":"width";if(s&&o){var l=function(e,t){return Y("number"!=typeof(e="function"==typeof e?e(Object.assign({},t.rects,{placement:t.placement})):e)?e:Z(e,A))}(r.padding,n),d=m(s),f="y"===c?x:S,p="y"===c?k:E,h=n.rects.reference[u]+n.rects.reference[c]-o[c]-n.rects.popper[u],b=o[c]-n.rects.reference[c],g=w(s),v=g?"y"===c?g.clientHeight||0:g.clientWidth||0:0,y=h/2-b/2,_=l[f],M=v-d[u]-l[p],I=v/2-d[u]/2+y,T=ge(_,I,M),j=c;n.modifiersData[i]=((t={})[j]=T,t.centerOffset=T-I,t)}},effect:function(t){var n=t.state,i=t.options.element,s=void 0===i?"[data-popper-arrow]":i;null!=s&&("string"!=typeof s||(s=n.elements.popper.querySelector(s)))&&("production"!==e.env.NODE_ENV&&(r(s)||console.error(['Popper: "arrow" element must be an HTMLElement (not an SVGElement).',"To use an SVG arrow, wrap it in an HTMLElement that will be used as","the arrow."].join(" "))),F(n.elements.popper,s)?n.elements.arrow=s:"production"!==e.env.NODE_ENV&&console.error(['Popper: "arrow" modifier\'s `element` must be a child of the popper',"element."].join(" ")))},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function _e(e,t,n){return void 0===n&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function we(e){return[x,E,k,S].some((function(t){return e[t]>=0}))}var xe={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(e){var t=e.state,n=e.name,i=t.rects.reference,r=t.rects.popper,s=t.modifiersData.preventOverflow,o=J(t,{elementContext:"reference"}),a=J(t,{altBoundary:!0}),c=_e(o,i),u=_e(a,r,s),l=we(c),d=we(u);t.modifiersData[n]={referenceClippingOffsets:c,popperEscapeOffsets:u,isReferenceHidden:l,hasPopperEscaped:d},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":l,"data-popper-escaped":d})}},ke=ne({defaultModifiers:[re,se,ce,ue]}),Ee=[re,se,ce,ue,le,be,ve,ye,xe],Se=ne({defaultModifiers:Ee});n.applyStyles=ue,n.arrow=ye,n.computeStyles=ce,n.createPopper=Se,n.createPopperLite=ke,n.defaultModifiers=Ee,n.detectOverflow=J,n.eventListeners=re,n.flip=be,n.hide=xe,n.offset=le,n.popperGenerator=ne,n.popperOffsets=se,n.preventOverflow=ve}).call(this)}).call(this,e("_process"))},{_process:342}],2:[function(e,t,n){(function(e){(function(){void 0===e&&(e=void 0),function(){"use strict";void 0===e&&(e=Array),t.exports=e}()}).call(this)}).call(this,e("buffer").Buffer)},{buffer:116}],3:[function(e,t,n){const i=/^\[?([^\]]+)]?:(\d+)$/;let r=new Map;t.exports=function(e){if(1e5===r.size&&r.clear(),!r.has(e)){const t=i.exec(e);if(!t)throw new Error(`invalid addr: ${e}`);r.set(e,[t[1],Number(t[2])])}return r.get(e)}},{}],4:[function(e,t,n){"use strict";const i=n;i.bignum=e("bn.js"),i.define=e("./asn1/api").define,i.base=e("./asn1/base"),i.constants=e("./asn1/constants"),i.decoders=e("./asn1/decoders"),i.encoders=e("./asn1/encoders")},{"./asn1/api":5,"./asn1/base":7,"./asn1/constants":11,"./asn1/decoders":13,"./asn1/encoders":16,"bn.js":18}],5:[function(e,t,n){"use strict";const i=e("./encoders"),r=e("./decoders"),s=e("inherits");function o(e,t){this.name=e,this.body=t,this.decoders={},this.encoders={}}n.define=function(e,t){return new o(e,t)},o.prototype._createNamed=function(e){const t=this.name;function n(e){this._initNamed(e,t)}return s(n,e),n.prototype._initNamed=function(t,n){e.call(this,t,n)},new n(this)},o.prototype._getDecoder=function(e){return e=e||"der",this.decoders.hasOwnProperty(e)||(this.decoders[e]=this._createNamed(r[e])),this.decoders[e]},o.prototype.decode=function(e,t,n){return this._getDecoder(t).decode(e,n)},o.prototype._getEncoder=function(e){return e=e||"der",this.encoders.hasOwnProperty(e)||(this.encoders[e]=this._createNamed(i[e])),this.encoders[e]},o.prototype.encode=function(e,t,n){return this._getEncoder(t).encode(e,n)}},{"./decoders":13,"./encoders":16,inherits:249}],6:[function(e,t,n){"use strict";const i=e("inherits"),r=e("../base/reporter").Reporter,s=e("safer-buffer").Buffer;function o(e,t){r.call(this,t),s.isBuffer(e)?(this.base=e,this.offset=0,this.length=e.length):this.error("Input not Buffer")}function a(e,t){if(Array.isArray(e))this.length=0,this.value=e.map((function(e){return a.isEncoderBuffer(e)||(e=new a(e,t)),this.length+=e.length,e}),this);else if("number"==typeof e){if(!(0<=e&&e<=255))return t.error("non-byte EncoderBuffer value");this.value=e,this.length=1}else if("string"==typeof e)this.value=e,this.length=s.byteLength(e);else{if(!s.isBuffer(e))return t.error("Unsupported type: "+typeof e);this.value=e,this.length=e.length}}i(o,r),n.DecoderBuffer=o,o.isDecoderBuffer=function(e){if(e instanceof o)return!0;return"object"==typeof e&&s.isBuffer(e.base)&&"DecoderBuffer"===e.constructor.name&&"number"==typeof e.offset&&"number"==typeof e.length&&"function"==typeof e.save&&"function"==typeof e.restore&&"function"==typeof e.isEmpty&&"function"==typeof e.readUInt8&&"function"==typeof e.skip&&"function"==typeof e.raw},o.prototype.save=function(){return{offset:this.offset,reporter:r.prototype.save.call(this)}},o.prototype.restore=function(e){const t=new o(this.base);return t.offset=e.offset,t.length=this.offset,this.offset=e.offset,r.prototype.restore.call(this,e.reporter),t},o.prototype.isEmpty=function(){return this.offset===this.length},o.prototype.readUInt8=function(e){return this.offset+1<=this.length?this.base.readUInt8(this.offset++,!0):this.error(e||"DecoderBuffer overrun")},o.prototype.skip=function(e,t){if(!(this.offset+e<=this.length))return this.error(t||"DecoderBuffer overrun");const n=new o(this.base);return n._reporterState=this._reporterState,n.offset=this.offset,n.length=this.offset+e,this.offset+=e,n},o.prototype.raw=function(e){return this.base.slice(e?e.offset:this.offset,this.length)},n.EncoderBuffer=a,a.isEncoderBuffer=function(e){if(e instanceof a)return!0;return"object"==typeof e&&"EncoderBuffer"===e.constructor.name&&"number"==typeof e.length&&"function"==typeof e.join},a.prototype.join=function(e,t){return e||(e=s.alloc(this.length)),t||(t=0),0===this.length||(Array.isArray(this.value)?this.value.forEach((function(n){n.join(e,t),t+=n.length})):("number"==typeof this.value?e[t]=this.value:"string"==typeof this.value?e.write(this.value,t):s.isBuffer(this.value)&&this.value.copy(e,t),t+=this.length)),e}},{"../base/reporter":9,inherits:249,"safer-buffer":387}],7:[function(e,t,n){"use strict";const i=n;i.Reporter=e("./reporter").Reporter,i.DecoderBuffer=e("./buffer").DecoderBuffer,i.EncoderBuffer=e("./buffer").EncoderBuffer,i.Node=e("./node")},{"./buffer":6,"./node":8,"./reporter":9}],8:[function(e,t,n){"use strict";const i=e("../base/reporter").Reporter,r=e("../base/buffer").EncoderBuffer,s=e("../base/buffer").DecoderBuffer,o=e("minimalistic-assert"),a=["seq","seqof","set","setof","objid","bool","gentime","utctime","null_","enum","int","objDesc","bitstr","bmpstr","charstr","genstr","graphstr","ia5str","iso646str","numstr","octstr","printstr","t61str","unistr","utf8str","videostr"],c=["key","obj","use","optional","explicit","implicit","def","choice","any","contains"].concat(a);function u(e,t,n){const i={};this._baseState=i,i.name=n,i.enc=e,i.parent=t||null,i.children=null,i.tag=null,i.args=null,i.reverseArgs=null,i.choice=null,i.optional=!1,i.any=!1,i.obj=!1,i.use=null,i.useDecoder=null,i.key=null,i.default=null,i.explicit=null,i.implicit=null,i.contains=null,i.parent||(i.children=[],this._wrap())}t.exports=u;const l=["enc","parent","children","tag","args","reverseArgs","choice","optional","any","obj","use","alteredUse","key","default","explicit","implicit","contains"];u.prototype.clone=function(){const e=this._baseState,t={};l.forEach((function(n){t[n]=e[n]}));const n=new this.constructor(t.parent);return n._baseState=t,n},u.prototype._wrap=function(){const e=this._baseState;c.forEach((function(t){this[t]=function(){const n=new this.constructor(this);return e.children.push(n),n[t].apply(n,arguments)}}),this)},u.prototype._init=function(e){const t=this._baseState;o(null===t.parent),e.call(this),t.children=t.children.filter((function(e){return e._baseState.parent===this}),this),o.equal(t.children.length,1,"Root node can have only one child")},u.prototype._useArgs=function(e){const t=this._baseState,n=e.filter((function(e){return e instanceof this.constructor}),this);e=e.filter((function(e){return!(e instanceof this.constructor)}),this),0!==n.length&&(o(null===t.children),t.children=n,n.forEach((function(e){e._baseState.parent=this}),this)),0!==e.length&&(o(null===t.args),t.args=e,t.reverseArgs=e.map((function(e){if("object"!=typeof e||e.constructor!==Object)return e;const t={};return Object.keys(e).forEach((function(n){n==(0|n)&&(n|=0);const i=e[n];t[i]=n})),t})))},["_peekTag","_decodeTag","_use","_decodeStr","_decodeObjid","_decodeTime","_decodeNull","_decodeInt","_decodeBool","_decodeList","_encodeComposite","_encodeStr","_encodeObjid","_encodeTime","_encodeNull","_encodeInt","_encodeBool"].forEach((function(e){u.prototype[e]=function(){const t=this._baseState;throw new Error(e+" not implemented for encoding: "+t.enc)}})),a.forEach((function(e){u.prototype[e]=function(){const t=this._baseState,n=Array.prototype.slice.call(arguments);return o(null===t.tag),t.tag=e,this._useArgs(n),this}})),u.prototype.use=function(e){o(e);const t=this._baseState;return o(null===t.use),t.use=e,this},u.prototype.optional=function(){return this._baseState.optional=!0,this},u.prototype.def=function(e){const t=this._baseState;return o(null===t.default),t.default=e,t.optional=!0,this},u.prototype.explicit=function(e){const t=this._baseState;return o(null===t.explicit&&null===t.implicit),t.explicit=e,this},u.prototype.implicit=function(e){const t=this._baseState;return o(null===t.explicit&&null===t.implicit),t.implicit=e,this},u.prototype.obj=function(){const e=this._baseState,t=Array.prototype.slice.call(arguments);return e.obj=!0,0!==t.length&&this._useArgs(t),this},u.prototype.key=function(e){const t=this._baseState;return o(null===t.key),t.key=e,this},u.prototype.any=function(){return this._baseState.any=!0,this},u.prototype.choice=function(e){const t=this._baseState;return o(null===t.choice),t.choice=e,this._useArgs(Object.keys(e).map((function(t){return e[t]}))),this},u.prototype.contains=function(e){const t=this._baseState;return o(null===t.use),t.contains=e,this},u.prototype._decode=function(e,t){const n=this._baseState;if(null===n.parent)return e.wrapResult(n.children[0]._decode(e,t));let i,r=n.default,o=!0,a=null;if(null!==n.key&&(a=e.enterKey(n.key)),n.optional){let i=null;if(null!==n.explicit?i=n.explicit:null!==n.implicit?i=n.implicit:null!==n.tag&&(i=n.tag),null!==i||n.any){if(o=this._peekTag(e,i,n.any),e.isError(o))return o}else{const i=e.save();try{null===n.choice?this._decodeGeneric(n.tag,e,t):this._decodeChoice(e,t),o=!0}catch(e){o=!1}e.restore(i)}}if(n.obj&&o&&(i=e.enterObject()),o){if(null!==n.explicit){const t=this._decodeTag(e,n.explicit);if(e.isError(t))return t;e=t}const i=e.offset;if(null===n.use&&null===n.choice){let t;n.any&&(t=e.save());const i=this._decodeTag(e,null!==n.implicit?n.implicit:n.tag,n.any);if(e.isError(i))return i;n.any?r=e.raw(t):e=i}if(t&&t.track&&null!==n.tag&&t.track(e.path(),i,e.length,"tagged"),t&&t.track&&null!==n.tag&&t.track(e.path(),e.offset,e.length,"content"),n.any||(r=null===n.choice?this._decodeGeneric(n.tag,e,t):this._decodeChoice(e,t)),e.isError(r))return r;if(n.any||null!==n.choice||null===n.children||n.children.forEach((function(n){n._decode(e,t)})),n.contains&&("octstr"===n.tag||"bitstr"===n.tag)){const i=new s(r);r=this._getUse(n.contains,e._reporterState.obj)._decode(i,t)}}return n.obj&&o&&(r=e.leaveObject(i)),null===n.key||null===r&&!0!==o?null!==a&&e.exitKey(a):e.leaveKey(a,n.key,r),r},u.prototype._decodeGeneric=function(e,t,n){const i=this._baseState;return"seq"===e||"set"===e?null:"seqof"===e||"setof"===e?this._decodeList(t,e,i.args[0],n):/str$/.test(e)?this._decodeStr(t,e,n):"objid"===e&&i.args?this._decodeObjid(t,i.args[0],i.args[1],n):"objid"===e?this._decodeObjid(t,null,null,n):"gentime"===e||"utctime"===e?this._decodeTime(t,e,n):"null_"===e?this._decodeNull(t,n):"bool"===e?this._decodeBool(t,n):"objDesc"===e?this._decodeStr(t,e,n):"int"===e||"enum"===e?this._decodeInt(t,i.args&&i.args[0],n):null!==i.use?this._getUse(i.use,t._reporterState.obj)._decode(t,n):t.error("unknown tag: "+e)},u.prototype._getUse=function(e,t){const n=this._baseState;return n.useDecoder=this._use(e,t),o(null===n.useDecoder._baseState.parent),n.useDecoder=n.useDecoder._baseState.children[0],n.implicit!==n.useDecoder._baseState.implicit&&(n.useDecoder=n.useDecoder.clone(),n.useDecoder._baseState.implicit=n.implicit),n.useDecoder},u.prototype._decodeChoice=function(e,t){const n=this._baseState;let i=null,r=!1;return Object.keys(n.choice).some((function(s){const o=e.save(),a=n.choice[s];try{const n=a._decode(e,t);if(e.isError(n))return!1;i={type:s,value:n},r=!0}catch(t){return e.restore(o),!1}return!0}),this),r?i:e.error("Choice not matched")},u.prototype._createEncoderBuffer=function(e){return new r(e,this.reporter)},u.prototype._encode=function(e,t,n){const i=this._baseState;if(null!==i.default&&i.default===e)return;const r=this._encodeValue(e,t,n);return void 0===r||this._skipDefault(r,t,n)?void 0:r},u.prototype._encodeValue=function(e,t,n){const r=this._baseState;if(null===r.parent)return r.children[0]._encode(e,t||new i);let s=null;if(this.reporter=t,r.optional&&void 0===e){if(null===r.default)return;e=r.default}let o=null,a=!1;if(r.any)s=this._createEncoderBuffer(e);else if(r.choice)s=this._encodeChoice(e,t);else if(r.contains)o=this._getUse(r.contains,n)._encode(e,t),a=!0;else if(r.children)o=r.children.map((function(n){if("null_"===n._baseState.tag)return n._encode(null,t,e);if(null===n._baseState.key)return t.error("Child should have a key");const i=t.enterKey(n._baseState.key);if("object"!=typeof e)return t.error("Child expected, but input is not object");const r=n._encode(e[n._baseState.key],t,e);return t.leaveKey(i),r}),this).filter((function(e){return e})),o=this._createEncoderBuffer(o);else if("seqof"===r.tag||"setof"===r.tag){if(!r.args||1!==r.args.length)return t.error("Too many args for : "+r.tag);if(!Array.isArray(e))return t.error("seqof/setof, but data is not Array");const n=this.clone();n._baseState.implicit=null,o=this._createEncoderBuffer(e.map((function(n){const i=this._baseState;return this._getUse(i.args[0],e)._encode(n,t)}),n))}else null!==r.use?s=this._getUse(r.use,n)._encode(e,t):(o=this._encodePrimitive(r.tag,e),a=!0);if(!r.any&&null===r.choice){const e=null!==r.implicit?r.implicit:r.tag,n=null===r.implicit?"universal":"context";null===e?null===r.use&&t.error("Tag could be omitted only for .use()"):null===r.use&&(s=this._encodeComposite(e,a,n,o))}return null!==r.explicit&&(s=this._encodeComposite(r.explicit,!1,"context",s)),s},u.prototype._encodeChoice=function(e,t){const n=this._baseState,i=n.choice[e.type];return i||o(!1,e.type+" not found in "+JSON.stringify(Object.keys(n.choice))),i._encode(e.value,t)},u.prototype._encodePrimitive=function(e,t){const n=this._baseState;if(/str$/.test(e))return this._encodeStr(t,e);if("objid"===e&&n.args)return this._encodeObjid(t,n.reverseArgs[0],n.args[1]);if("objid"===e)return this._encodeObjid(t,null,null);if("gentime"===e||"utctime"===e)return this._encodeTime(t,e);if("null_"===e)return this._encodeNull();if("int"===e||"enum"===e)return this._encodeInt(t,n.args&&n.reverseArgs[0]);if("bool"===e)return this._encodeBool(t);if("objDesc"===e)return this._encodeStr(t,e);throw new Error("Unsupported tag: "+e)},u.prototype._isNumstr=function(e){return/^[0-9 ]*$/.test(e)},u.prototype._isPrintstr=function(e){return/^[A-Za-z0-9 '()+,-./:=?]*$/.test(e)}},{"../base/buffer":6,"../base/reporter":9,"minimalistic-assert":287}],9:[function(e,t,n){"use strict";const i=e("inherits");function r(e){this._reporterState={obj:null,path:[],options:e||{},errors:[]}}function s(e,t){this.path=e,this.rethrow(t)}n.Reporter=r,r.prototype.isError=function(e){return e instanceof s},r.prototype.save=function(){const e=this._reporterState;return{obj:e.obj,pathLen:e.path.length}},r.prototype.restore=function(e){const t=this._reporterState;t.obj=e.obj,t.path=t.path.slice(0,e.pathLen)},r.prototype.enterKey=function(e){return this._reporterState.path.push(e)},r.prototype.exitKey=function(e){const t=this._reporterState;t.path=t.path.slice(0,e-1)},r.prototype.leaveKey=function(e,t,n){const i=this._reporterState;this.exitKey(e),null!==i.obj&&(i.obj[t]=n)},r.prototype.path=function(){return this._reporterState.path.join("/")},r.prototype.enterObject=function(){const e=this._reporterState,t=e.obj;return e.obj={},t},r.prototype.leaveObject=function(e){const t=this._reporterState,n=t.obj;return t.obj=e,n},r.prototype.error=function(e){let t;const n=this._reporterState,i=e instanceof s;if(t=i?e:new s(n.path.map((function(e){return"["+JSON.stringify(e)+"]"})).join(""),e.message||e,e.stack),!n.options.partial)throw t;return i||n.errors.push(t),t},r.prototype.wrapResult=function(e){const t=this._reporterState;return t.options.partial?{result:this.isError(e)?null:e,errors:t.errors}:e},i(s,Error),s.prototype.rethrow=function(e){if(this.message=e+" at: "+(this.path||"(shallow)"),Error.captureStackTrace&&Error.captureStackTrace(this,s),!this.stack)try{throw new Error(this.message)}catch(e){this.stack=e.stack}return this}},{inherits:249}],10:[function(e,t,n){"use strict";function i(e){const t={};return Object.keys(e).forEach((function(n){(0|n)==n&&(n|=0);const i=e[n];t[i]=n})),t}n.tagClass={0:"universal",1:"application",2:"context",3:"private"},n.tagClassByName=i(n.tagClass),n.tag={0:"end",1:"bool",2:"int",3:"bitstr",4:"octstr",5:"null_",6:"objid",7:"objDesc",8:"external",9:"real",10:"enum",11:"embed",12:"utf8str",13:"relativeOid",16:"seq",17:"set",18:"numstr",19:"printstr",20:"t61str",21:"videostr",22:"ia5str",23:"utctime",24:"gentime",25:"graphstr",26:"iso646str",27:"genstr",28:"unistr",29:"charstr",30:"bmpstr"},n.tagByName=i(n.tag)},{}],11:[function(e,t,n){"use strict";const i=n;i._reverse=function(e){const t={};return Object.keys(e).forEach((function(n){(0|n)==n&&(n|=0);const i=e[n];t[i]=n})),t},i.der=e("./der")},{"./der":10}],12:[function(e,t,n){"use strict";const i=e("inherits"),r=e("bn.js"),s=e("../base/buffer").DecoderBuffer,o=e("../base/node"),a=e("../constants/der");function c(e){this.enc="der",this.name=e.name,this.entity=e,this.tree=new u,this.tree._init(e.body)}function u(e){o.call(this,"der",e)}function l(e,t){let n=e.readUInt8(t);if(e.isError(n))return n;const i=a.tagClass[n>>6],r=0==(32&n);if(31==(31&n)){let i=n;for(n=0;128==(128&i);){if(i=e.readUInt8(t),e.isError(i))return i;n<<=7,n|=127&i}}else n&=31;return{cls:i,primitive:r,tag:n,tagStr:a.tag[n]}}function d(e,t,n){let i=e.readUInt8(n);if(e.isError(i))return i;if(!t&&128===i)return null;if(0==(128&i))return i;const r=127&i;if(r>4)return e.error("length octect is too long");i=0;for(let t=0;t=31)return i.error("Multi-octet tag encoding unsupported");t||(r|=32);return r|=o.tagClassByName[n||"universal"]<<6,r}(e,t,n,this.reporter);if(i.length<128){const e=r.alloc(2);return e[0]=s,e[1]=i.length,this._createEncoderBuffer([e,i])}let a=1;for(let e=i.length;e>=256;e>>=8)a++;const c=r.alloc(2+a);c[0]=s,c[1]=128|a;for(let e=1+a,t=i.length;t>0;e--,t>>=8)c[e]=255&t;return this._createEncoderBuffer([c,i])},c.prototype._encodeStr=function(e,t){if("bitstr"===t)return this._createEncoderBuffer([0|e.unused,e.data]);if("bmpstr"===t){const t=r.alloc(2*e.length);for(let n=0;n=40)return this.reporter.error("Second objid identifier OOB");e.splice(0,2,40*e[0]+e[1])}let i=0;for(let t=0;t=128;n>>=7)i++}const s=r.alloc(i);let o=s.length-1;for(let t=e.length-1;t>=0;t--){let n=e[t];for(s[o--]=127&n;(n>>=7)>0;)s[o--]=128|127&n}return this._createEncoderBuffer(s)},c.prototype._encodeTime=function(e,t){let n;const i=new Date(e);return"gentime"===t?n=[u(i.getUTCFullYear()),u(i.getUTCMonth()+1),u(i.getUTCDate()),u(i.getUTCHours()),u(i.getUTCMinutes()),u(i.getUTCSeconds()),"Z"].join(""):"utctime"===t?n=[u(i.getUTCFullYear()%100),u(i.getUTCMonth()+1),u(i.getUTCDate()),u(i.getUTCHours()),u(i.getUTCMinutes()),u(i.getUTCSeconds()),"Z"].join(""):this.reporter.error("Encoding "+t+" time is not supported yet"),this._encodeStr(n,"octstr")},c.prototype._encodeNull=function(){return this._createEncoderBuffer("")},c.prototype._encodeInt=function(e,t){if("string"==typeof e){if(!t)return this.reporter.error("String int or enum given, but no values map");if(!t.hasOwnProperty(e))return this.reporter.error("Values map doesn't contain: "+JSON.stringify(e));e=t[e]}if("number"!=typeof e&&!r.isBuffer(e)){const t=e.toArray();!e.sign&&128&t[0]&&t.unshift(0),e=r.from(t)}if(r.isBuffer(e)){let t=e.length;0===e.length&&t++;const n=r.alloc(t);return e.copy(n),0===e.length&&(n[0]=0),this._createEncoderBuffer(n)}if(e<128)return this._createEncoderBuffer(e);if(e<256)return this._createEncoderBuffer([0,e]);let n=1;for(let t=e;t>=256;t>>=8)n++;const i=new Array(n);for(let t=i.length-1;t>=0;t--)i[t]=255&e,e>>=8;return 128&i[0]&&i.unshift(0),this._createEncoderBuffer(r.from(i))},c.prototype._encodeBool=function(e){return this._createEncoderBuffer(e?255:0)},c.prototype._use=function(e,t){return"function"==typeof e&&(e=e(t)),e._getEncoder("der").tree},c.prototype._skipDefault=function(e,t,n){const i=this._baseState;let r;if(null===i.default)return!1;const s=e.join();if(void 0===i.defaultBuffer&&(i.defaultBuffer=this._encodeValue(i.default,t,n).join()),s.length!==i.defaultBuffer.length)return!1;for(r=0;r=65&&n<=70?n-55:n>=97&&n<=102?n-87:n-48&15}function c(e,t,n){var i=a(e,n);return n-1>=t&&(i|=a(e,n-1)<<4),i}function u(e,t,n,i){for(var r=0,s=Math.min(e.length,n),o=t;o=49?a-49+10:a>=17?a-17+10:a}return r}s.isBN=function(e){return e instanceof s||null!==e&&"object"==typeof e&&e.constructor.wordSize===s.wordSize&&Array.isArray(e.words)},s.max=function(e,t){return e.cmp(t)>0?e:t},s.min=function(e,t){return e.cmp(t)<0?e:t},s.prototype._init=function(e,t,n){if("number"==typeof e)return this._initNumber(e,t,n);if("object"==typeof e)return this._initArray(e,t,n);"hex"===t&&(t=16),i(t===(0|t)&&t>=2&&t<=36);var r=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(r++,this.negative=1),r=0;r-=3)o=e[r]|e[r-1]<<8|e[r-2]<<16,this.words[s]|=o<>>26-a&67108863,(a+=24)>=26&&(a-=26,s++);else if("le"===n)for(r=0,s=0;r>>26-a&67108863,(a+=24)>=26&&(a-=26,s++);return this.strip()},s.prototype._parseHex=function(e,t,n){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var i=0;i=t;i-=2)r=c(e,t,i)<=18?(s-=18,o+=1,this.words[o]|=r>>>26):s+=8;else for(i=(e.length-t)%2==0?t+1:t;i=18?(s-=18,o+=1,this.words[o]|=r>>>26):s+=8;this.strip()},s.prototype._parseBase=function(e,t,n){this.words=[0],this.length=1;for(var i=0,r=1;r<=67108863;r*=t)i++;i--,r=r/t|0;for(var s=e.length-n,o=s%i,a=Math.min(s,s-o)+n,c=0,l=n;l1&&0===this.words[this.length-1];)this.length--;return this._normSign()},s.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},s.prototype.inspect=function(){return(this.red?""};var l=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],d=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],f=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function p(e,t,n){n.negative=t.negative^e.negative;var i=e.length+t.length|0;n.length=i,i=i-1|0;var r=0|e.words[0],s=0|t.words[0],o=r*s,a=67108863&o,c=o/67108864|0;n.words[0]=a;for(var u=1;u>>26,d=67108863&c,f=Math.min(u,t.length-1),p=Math.max(0,u-e.length+1);p<=f;p++){var h=u-p|0;l+=(o=(r=0|e.words[h])*(s=0|t.words[p])+d)/67108864|0,d=67108863&o}n.words[u]=0|d,c=0|l}return 0!==c?n.words[u]=0|c:n.length--,n.strip()}s.prototype.toString=function(e,t){var n;if(t=0|t||1,16===(e=e||10)||"hex"===e){n="";for(var r=0,s=0,o=0;o>>24-r&16777215)||o!==this.length-1?l[6-c.length]+c+n:c+n,(r+=2)>=26&&(r-=26,o--)}for(0!==s&&(n=s.toString(16)+n);n.length%t!=0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}if(e===(0|e)&&e>=2&&e<=36){var u=d[e],p=f[e];n="";var h=this.clone();for(h.negative=0;!h.isZero();){var m=h.modn(p).toString(e);n=(h=h.idivn(p)).isZero()?m+n:l[u-m.length]+m+n}for(this.isZero()&&(n="0"+n);n.length%t!=0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}i(!1,"Base should be between 2 and 36")},s.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&i(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},s.prototype.toJSON=function(){return this.toString(16)},s.prototype.toBuffer=function(e,t){return i(void 0!==o),this.toArrayLike(o,e,t)},s.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},s.prototype.toArrayLike=function(e,t,n){var r=this.byteLength(),s=n||Math.max(1,r);i(r<=s,"byte array longer than desired length"),i(s>0,"Requested array length <= 0"),this.strip();var o,a,c="le"===t,u=new e(s),l=this.clone();if(c){for(a=0;!l.isZero();a++)o=l.andln(255),l.iushrn(8),u[a]=o;for(;a=4096&&(n+=13,t>>>=13),t>=64&&(n+=7,t>>>=7),t>=8&&(n+=4,t>>>=4),t>=2&&(n+=2,t>>>=2),n+t},s.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,n=0;return 0==(8191&t)&&(n+=13,t>>>=13),0==(127&t)&&(n+=7,t>>>=7),0==(15&t)&&(n+=4,t>>>=4),0==(3&t)&&(n+=2,t>>>=2),0==(1&t)&&n++,n},s.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},s.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},s.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},s.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var n=0;ne.length?this.clone().iand(e):e.clone().iand(this)},s.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},s.prototype.iuxor=function(e){var t,n;this.length>e.length?(t=this,n=e):(t=e,n=this);for(var i=0;ie.length?this.clone().ixor(e):e.clone().ixor(this)},s.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},s.prototype.inotn=function(e){i("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),n=e%26;this._expand(t),n>0&&t--;for(var r=0;r0&&(this.words[r]=~this.words[r]&67108863>>26-n),this.strip()},s.prototype.notn=function(e){return this.clone().inotn(e)},s.prototype.setn=function(e,t){i("number"==typeof e&&e>=0);var n=e/26|0,r=e%26;return this._expand(n+1),this.words[n]=t?this.words[n]|1<e.length?(n=this,i=e):(n=e,i=this);for(var r=0,s=0;s>>26;for(;0!==r&&s>>26;if(this.length=n.length,0!==r)this.words[this.length]=r,this.length++;else if(n!==this)for(;se.length?this.clone().iadd(e):e.clone().iadd(this)},s.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var n,i,r=this.cmp(e);if(0===r)return this.negative=0,this.length=1,this.words[0]=0,this;r>0?(n=this,i=e):(n=e,i=this);for(var s=0,o=0;o>26,this.words[o]=67108863&t;for(;0!==s&&o>26,this.words[o]=67108863&t;if(0===s&&o>>13,p=0|o[1],h=8191&p,m=p>>>13,b=0|o[2],g=8191&b,v=b>>>13,y=0|o[3],_=8191&y,w=y>>>13,x=0|o[4],k=8191&x,E=x>>>13,S=0|o[5],M=8191&S,A=S>>>13,I=0|o[6],T=8191&I,j=I>>>13,C=0|o[7],B=8191&C,R=C>>>13,L=0|o[8],O=8191&L,P=L>>>13,U=0|o[9],q=8191&U,N=U>>>13,D=0|a[0],z=8191&D,H=D>>>13,F=0|a[1],W=8191&F,V=F>>>13,K=0|a[2],$=8191&K,G=K>>>13,X=0|a[3],Y=8191&X,Z=X>>>13,J=0|a[4],Q=8191&J,ee=J>>>13,te=0|a[5],ne=8191&te,ie=te>>>13,re=0|a[6],se=8191&re,oe=re>>>13,ae=0|a[7],ce=8191&ae,ue=ae>>>13,le=0|a[8],de=8191&le,fe=le>>>13,pe=0|a[9],he=8191&pe,me=pe>>>13;n.negative=e.negative^t.negative,n.length=19;var be=(u+(i=Math.imul(d,z))|0)+((8191&(r=(r=Math.imul(d,H))+Math.imul(f,z)|0))<<13)|0;u=((s=Math.imul(f,H))+(r>>>13)|0)+(be>>>26)|0,be&=67108863,i=Math.imul(h,z),r=(r=Math.imul(h,H))+Math.imul(m,z)|0,s=Math.imul(m,H);var ge=(u+(i=i+Math.imul(d,W)|0)|0)+((8191&(r=(r=r+Math.imul(d,V)|0)+Math.imul(f,W)|0))<<13)|0;u=((s=s+Math.imul(f,V)|0)+(r>>>13)|0)+(ge>>>26)|0,ge&=67108863,i=Math.imul(g,z),r=(r=Math.imul(g,H))+Math.imul(v,z)|0,s=Math.imul(v,H),i=i+Math.imul(h,W)|0,r=(r=r+Math.imul(h,V)|0)+Math.imul(m,W)|0,s=s+Math.imul(m,V)|0;var ve=(u+(i=i+Math.imul(d,$)|0)|0)+((8191&(r=(r=r+Math.imul(d,G)|0)+Math.imul(f,$)|0))<<13)|0;u=((s=s+Math.imul(f,G)|0)+(r>>>13)|0)+(ve>>>26)|0,ve&=67108863,i=Math.imul(_,z),r=(r=Math.imul(_,H))+Math.imul(w,z)|0,s=Math.imul(w,H),i=i+Math.imul(g,W)|0,r=(r=r+Math.imul(g,V)|0)+Math.imul(v,W)|0,s=s+Math.imul(v,V)|0,i=i+Math.imul(h,$)|0,r=(r=r+Math.imul(h,G)|0)+Math.imul(m,$)|0,s=s+Math.imul(m,G)|0;var ye=(u+(i=i+Math.imul(d,Y)|0)|0)+((8191&(r=(r=r+Math.imul(d,Z)|0)+Math.imul(f,Y)|0))<<13)|0;u=((s=s+Math.imul(f,Z)|0)+(r>>>13)|0)+(ye>>>26)|0,ye&=67108863,i=Math.imul(k,z),r=(r=Math.imul(k,H))+Math.imul(E,z)|0,s=Math.imul(E,H),i=i+Math.imul(_,W)|0,r=(r=r+Math.imul(_,V)|0)+Math.imul(w,W)|0,s=s+Math.imul(w,V)|0,i=i+Math.imul(g,$)|0,r=(r=r+Math.imul(g,G)|0)+Math.imul(v,$)|0,s=s+Math.imul(v,G)|0,i=i+Math.imul(h,Y)|0,r=(r=r+Math.imul(h,Z)|0)+Math.imul(m,Y)|0,s=s+Math.imul(m,Z)|0;var _e=(u+(i=i+Math.imul(d,Q)|0)|0)+((8191&(r=(r=r+Math.imul(d,ee)|0)+Math.imul(f,Q)|0))<<13)|0;u=((s=s+Math.imul(f,ee)|0)+(r>>>13)|0)+(_e>>>26)|0,_e&=67108863,i=Math.imul(M,z),r=(r=Math.imul(M,H))+Math.imul(A,z)|0,s=Math.imul(A,H),i=i+Math.imul(k,W)|0,r=(r=r+Math.imul(k,V)|0)+Math.imul(E,W)|0,s=s+Math.imul(E,V)|0,i=i+Math.imul(_,$)|0,r=(r=r+Math.imul(_,G)|0)+Math.imul(w,$)|0,s=s+Math.imul(w,G)|0,i=i+Math.imul(g,Y)|0,r=(r=r+Math.imul(g,Z)|0)+Math.imul(v,Y)|0,s=s+Math.imul(v,Z)|0,i=i+Math.imul(h,Q)|0,r=(r=r+Math.imul(h,ee)|0)+Math.imul(m,Q)|0,s=s+Math.imul(m,ee)|0;var we=(u+(i=i+Math.imul(d,ne)|0)|0)+((8191&(r=(r=r+Math.imul(d,ie)|0)+Math.imul(f,ne)|0))<<13)|0;u=((s=s+Math.imul(f,ie)|0)+(r>>>13)|0)+(we>>>26)|0,we&=67108863,i=Math.imul(T,z),r=(r=Math.imul(T,H))+Math.imul(j,z)|0,s=Math.imul(j,H),i=i+Math.imul(M,W)|0,r=(r=r+Math.imul(M,V)|0)+Math.imul(A,W)|0,s=s+Math.imul(A,V)|0,i=i+Math.imul(k,$)|0,r=(r=r+Math.imul(k,G)|0)+Math.imul(E,$)|0,s=s+Math.imul(E,G)|0,i=i+Math.imul(_,Y)|0,r=(r=r+Math.imul(_,Z)|0)+Math.imul(w,Y)|0,s=s+Math.imul(w,Z)|0,i=i+Math.imul(g,Q)|0,r=(r=r+Math.imul(g,ee)|0)+Math.imul(v,Q)|0,s=s+Math.imul(v,ee)|0,i=i+Math.imul(h,ne)|0,r=(r=r+Math.imul(h,ie)|0)+Math.imul(m,ne)|0,s=s+Math.imul(m,ie)|0;var xe=(u+(i=i+Math.imul(d,se)|0)|0)+((8191&(r=(r=r+Math.imul(d,oe)|0)+Math.imul(f,se)|0))<<13)|0;u=((s=s+Math.imul(f,oe)|0)+(r>>>13)|0)+(xe>>>26)|0,xe&=67108863,i=Math.imul(B,z),r=(r=Math.imul(B,H))+Math.imul(R,z)|0,s=Math.imul(R,H),i=i+Math.imul(T,W)|0,r=(r=r+Math.imul(T,V)|0)+Math.imul(j,W)|0,s=s+Math.imul(j,V)|0,i=i+Math.imul(M,$)|0,r=(r=r+Math.imul(M,G)|0)+Math.imul(A,$)|0,s=s+Math.imul(A,G)|0,i=i+Math.imul(k,Y)|0,r=(r=r+Math.imul(k,Z)|0)+Math.imul(E,Y)|0,s=s+Math.imul(E,Z)|0,i=i+Math.imul(_,Q)|0,r=(r=r+Math.imul(_,ee)|0)+Math.imul(w,Q)|0,s=s+Math.imul(w,ee)|0,i=i+Math.imul(g,ne)|0,r=(r=r+Math.imul(g,ie)|0)+Math.imul(v,ne)|0,s=s+Math.imul(v,ie)|0,i=i+Math.imul(h,se)|0,r=(r=r+Math.imul(h,oe)|0)+Math.imul(m,se)|0,s=s+Math.imul(m,oe)|0;var ke=(u+(i=i+Math.imul(d,ce)|0)|0)+((8191&(r=(r=r+Math.imul(d,ue)|0)+Math.imul(f,ce)|0))<<13)|0;u=((s=s+Math.imul(f,ue)|0)+(r>>>13)|0)+(ke>>>26)|0,ke&=67108863,i=Math.imul(O,z),r=(r=Math.imul(O,H))+Math.imul(P,z)|0,s=Math.imul(P,H),i=i+Math.imul(B,W)|0,r=(r=r+Math.imul(B,V)|0)+Math.imul(R,W)|0,s=s+Math.imul(R,V)|0,i=i+Math.imul(T,$)|0,r=(r=r+Math.imul(T,G)|0)+Math.imul(j,$)|0,s=s+Math.imul(j,G)|0,i=i+Math.imul(M,Y)|0,r=(r=r+Math.imul(M,Z)|0)+Math.imul(A,Y)|0,s=s+Math.imul(A,Z)|0,i=i+Math.imul(k,Q)|0,r=(r=r+Math.imul(k,ee)|0)+Math.imul(E,Q)|0,s=s+Math.imul(E,ee)|0,i=i+Math.imul(_,ne)|0,r=(r=r+Math.imul(_,ie)|0)+Math.imul(w,ne)|0,s=s+Math.imul(w,ie)|0,i=i+Math.imul(g,se)|0,r=(r=r+Math.imul(g,oe)|0)+Math.imul(v,se)|0,s=s+Math.imul(v,oe)|0,i=i+Math.imul(h,ce)|0,r=(r=r+Math.imul(h,ue)|0)+Math.imul(m,ce)|0,s=s+Math.imul(m,ue)|0;var Ee=(u+(i=i+Math.imul(d,de)|0)|0)+((8191&(r=(r=r+Math.imul(d,fe)|0)+Math.imul(f,de)|0))<<13)|0;u=((s=s+Math.imul(f,fe)|0)+(r>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,i=Math.imul(q,z),r=(r=Math.imul(q,H))+Math.imul(N,z)|0,s=Math.imul(N,H),i=i+Math.imul(O,W)|0,r=(r=r+Math.imul(O,V)|0)+Math.imul(P,W)|0,s=s+Math.imul(P,V)|0,i=i+Math.imul(B,$)|0,r=(r=r+Math.imul(B,G)|0)+Math.imul(R,$)|0,s=s+Math.imul(R,G)|0,i=i+Math.imul(T,Y)|0,r=(r=r+Math.imul(T,Z)|0)+Math.imul(j,Y)|0,s=s+Math.imul(j,Z)|0,i=i+Math.imul(M,Q)|0,r=(r=r+Math.imul(M,ee)|0)+Math.imul(A,Q)|0,s=s+Math.imul(A,ee)|0,i=i+Math.imul(k,ne)|0,r=(r=r+Math.imul(k,ie)|0)+Math.imul(E,ne)|0,s=s+Math.imul(E,ie)|0,i=i+Math.imul(_,se)|0,r=(r=r+Math.imul(_,oe)|0)+Math.imul(w,se)|0,s=s+Math.imul(w,oe)|0,i=i+Math.imul(g,ce)|0,r=(r=r+Math.imul(g,ue)|0)+Math.imul(v,ce)|0,s=s+Math.imul(v,ue)|0,i=i+Math.imul(h,de)|0,r=(r=r+Math.imul(h,fe)|0)+Math.imul(m,de)|0,s=s+Math.imul(m,fe)|0;var Se=(u+(i=i+Math.imul(d,he)|0)|0)+((8191&(r=(r=r+Math.imul(d,me)|0)+Math.imul(f,he)|0))<<13)|0;u=((s=s+Math.imul(f,me)|0)+(r>>>13)|0)+(Se>>>26)|0,Se&=67108863,i=Math.imul(q,W),r=(r=Math.imul(q,V))+Math.imul(N,W)|0,s=Math.imul(N,V),i=i+Math.imul(O,$)|0,r=(r=r+Math.imul(O,G)|0)+Math.imul(P,$)|0,s=s+Math.imul(P,G)|0,i=i+Math.imul(B,Y)|0,r=(r=r+Math.imul(B,Z)|0)+Math.imul(R,Y)|0,s=s+Math.imul(R,Z)|0,i=i+Math.imul(T,Q)|0,r=(r=r+Math.imul(T,ee)|0)+Math.imul(j,Q)|0,s=s+Math.imul(j,ee)|0,i=i+Math.imul(M,ne)|0,r=(r=r+Math.imul(M,ie)|0)+Math.imul(A,ne)|0,s=s+Math.imul(A,ie)|0,i=i+Math.imul(k,se)|0,r=(r=r+Math.imul(k,oe)|0)+Math.imul(E,se)|0,s=s+Math.imul(E,oe)|0,i=i+Math.imul(_,ce)|0,r=(r=r+Math.imul(_,ue)|0)+Math.imul(w,ce)|0,s=s+Math.imul(w,ue)|0,i=i+Math.imul(g,de)|0,r=(r=r+Math.imul(g,fe)|0)+Math.imul(v,de)|0,s=s+Math.imul(v,fe)|0;var Me=(u+(i=i+Math.imul(h,he)|0)|0)+((8191&(r=(r=r+Math.imul(h,me)|0)+Math.imul(m,he)|0))<<13)|0;u=((s=s+Math.imul(m,me)|0)+(r>>>13)|0)+(Me>>>26)|0,Me&=67108863,i=Math.imul(q,$),r=(r=Math.imul(q,G))+Math.imul(N,$)|0,s=Math.imul(N,G),i=i+Math.imul(O,Y)|0,r=(r=r+Math.imul(O,Z)|0)+Math.imul(P,Y)|0,s=s+Math.imul(P,Z)|0,i=i+Math.imul(B,Q)|0,r=(r=r+Math.imul(B,ee)|0)+Math.imul(R,Q)|0,s=s+Math.imul(R,ee)|0,i=i+Math.imul(T,ne)|0,r=(r=r+Math.imul(T,ie)|0)+Math.imul(j,ne)|0,s=s+Math.imul(j,ie)|0,i=i+Math.imul(M,se)|0,r=(r=r+Math.imul(M,oe)|0)+Math.imul(A,se)|0,s=s+Math.imul(A,oe)|0,i=i+Math.imul(k,ce)|0,r=(r=r+Math.imul(k,ue)|0)+Math.imul(E,ce)|0,s=s+Math.imul(E,ue)|0,i=i+Math.imul(_,de)|0,r=(r=r+Math.imul(_,fe)|0)+Math.imul(w,de)|0,s=s+Math.imul(w,fe)|0;var Ae=(u+(i=i+Math.imul(g,he)|0)|0)+((8191&(r=(r=r+Math.imul(g,me)|0)+Math.imul(v,he)|0))<<13)|0;u=((s=s+Math.imul(v,me)|0)+(r>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,i=Math.imul(q,Y),r=(r=Math.imul(q,Z))+Math.imul(N,Y)|0,s=Math.imul(N,Z),i=i+Math.imul(O,Q)|0,r=(r=r+Math.imul(O,ee)|0)+Math.imul(P,Q)|0,s=s+Math.imul(P,ee)|0,i=i+Math.imul(B,ne)|0,r=(r=r+Math.imul(B,ie)|0)+Math.imul(R,ne)|0,s=s+Math.imul(R,ie)|0,i=i+Math.imul(T,se)|0,r=(r=r+Math.imul(T,oe)|0)+Math.imul(j,se)|0,s=s+Math.imul(j,oe)|0,i=i+Math.imul(M,ce)|0,r=(r=r+Math.imul(M,ue)|0)+Math.imul(A,ce)|0,s=s+Math.imul(A,ue)|0,i=i+Math.imul(k,de)|0,r=(r=r+Math.imul(k,fe)|0)+Math.imul(E,de)|0,s=s+Math.imul(E,fe)|0;var Ie=(u+(i=i+Math.imul(_,he)|0)|0)+((8191&(r=(r=r+Math.imul(_,me)|0)+Math.imul(w,he)|0))<<13)|0;u=((s=s+Math.imul(w,me)|0)+(r>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,i=Math.imul(q,Q),r=(r=Math.imul(q,ee))+Math.imul(N,Q)|0,s=Math.imul(N,ee),i=i+Math.imul(O,ne)|0,r=(r=r+Math.imul(O,ie)|0)+Math.imul(P,ne)|0,s=s+Math.imul(P,ie)|0,i=i+Math.imul(B,se)|0,r=(r=r+Math.imul(B,oe)|0)+Math.imul(R,se)|0,s=s+Math.imul(R,oe)|0,i=i+Math.imul(T,ce)|0,r=(r=r+Math.imul(T,ue)|0)+Math.imul(j,ce)|0,s=s+Math.imul(j,ue)|0,i=i+Math.imul(M,de)|0,r=(r=r+Math.imul(M,fe)|0)+Math.imul(A,de)|0,s=s+Math.imul(A,fe)|0;var Te=(u+(i=i+Math.imul(k,he)|0)|0)+((8191&(r=(r=r+Math.imul(k,me)|0)+Math.imul(E,he)|0))<<13)|0;u=((s=s+Math.imul(E,me)|0)+(r>>>13)|0)+(Te>>>26)|0,Te&=67108863,i=Math.imul(q,ne),r=(r=Math.imul(q,ie))+Math.imul(N,ne)|0,s=Math.imul(N,ie),i=i+Math.imul(O,se)|0,r=(r=r+Math.imul(O,oe)|0)+Math.imul(P,se)|0,s=s+Math.imul(P,oe)|0,i=i+Math.imul(B,ce)|0,r=(r=r+Math.imul(B,ue)|0)+Math.imul(R,ce)|0,s=s+Math.imul(R,ue)|0,i=i+Math.imul(T,de)|0,r=(r=r+Math.imul(T,fe)|0)+Math.imul(j,de)|0,s=s+Math.imul(j,fe)|0;var je=(u+(i=i+Math.imul(M,he)|0)|0)+((8191&(r=(r=r+Math.imul(M,me)|0)+Math.imul(A,he)|0))<<13)|0;u=((s=s+Math.imul(A,me)|0)+(r>>>13)|0)+(je>>>26)|0,je&=67108863,i=Math.imul(q,se),r=(r=Math.imul(q,oe))+Math.imul(N,se)|0,s=Math.imul(N,oe),i=i+Math.imul(O,ce)|0,r=(r=r+Math.imul(O,ue)|0)+Math.imul(P,ce)|0,s=s+Math.imul(P,ue)|0,i=i+Math.imul(B,de)|0,r=(r=r+Math.imul(B,fe)|0)+Math.imul(R,de)|0,s=s+Math.imul(R,fe)|0;var Ce=(u+(i=i+Math.imul(T,he)|0)|0)+((8191&(r=(r=r+Math.imul(T,me)|0)+Math.imul(j,he)|0))<<13)|0;u=((s=s+Math.imul(j,me)|0)+(r>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,i=Math.imul(q,ce),r=(r=Math.imul(q,ue))+Math.imul(N,ce)|0,s=Math.imul(N,ue),i=i+Math.imul(O,de)|0,r=(r=r+Math.imul(O,fe)|0)+Math.imul(P,de)|0,s=s+Math.imul(P,fe)|0;var Be=(u+(i=i+Math.imul(B,he)|0)|0)+((8191&(r=(r=r+Math.imul(B,me)|0)+Math.imul(R,he)|0))<<13)|0;u=((s=s+Math.imul(R,me)|0)+(r>>>13)|0)+(Be>>>26)|0,Be&=67108863,i=Math.imul(q,de),r=(r=Math.imul(q,fe))+Math.imul(N,de)|0,s=Math.imul(N,fe);var Re=(u+(i=i+Math.imul(O,he)|0)|0)+((8191&(r=(r=r+Math.imul(O,me)|0)+Math.imul(P,he)|0))<<13)|0;u=((s=s+Math.imul(P,me)|0)+(r>>>13)|0)+(Re>>>26)|0,Re&=67108863;var Le=(u+(i=Math.imul(q,he))|0)+((8191&(r=(r=Math.imul(q,me))+Math.imul(N,he)|0))<<13)|0;return u=((s=Math.imul(N,me))+(r>>>13)|0)+(Le>>>26)|0,Le&=67108863,c[0]=be,c[1]=ge,c[2]=ve,c[3]=ye,c[4]=_e,c[5]=we,c[6]=xe,c[7]=ke,c[8]=Ee,c[9]=Se,c[10]=Me,c[11]=Ae,c[12]=Ie,c[13]=Te,c[14]=je,c[15]=Ce,c[16]=Be,c[17]=Re,c[18]=Le,0!==u&&(c[19]=u,n.length++),n};function m(e,t,n){return(new b).mulp(e,t,n)}function b(e,t){this.x=e,this.y=t}Math.imul||(h=p),s.prototype.mulTo=function(e,t){var n=this.length+e.length;return 10===this.length&&10===e.length?h(this,e,t):n<63?p(this,e,t):n<1024?function(e,t,n){n.negative=t.negative^e.negative,n.length=e.length+t.length;for(var i=0,r=0,s=0;s>>26)|0)>>>26,o&=67108863}n.words[s]=a,i=o,o=r}return 0!==i?n.words[s]=i:n.length--,n.strip()}(this,e,t):m(this,e,t)},b.prototype.makeRBT=function(e){for(var t=new Array(e),n=s.prototype._countBits(e)-1,i=0;i>=1;return i},b.prototype.permute=function(e,t,n,i,r,s){for(var o=0;o>>=1)r++;return 1<>>=13,n[2*o+1]=8191&s,s>>>=13;for(o=2*t;o>=26,t+=r/67108864|0,t+=s>>>26,this.words[n]=67108863&s}return 0!==t&&(this.words[n]=t,this.length++),this},s.prototype.muln=function(e){return this.clone().imuln(e)},s.prototype.sqr=function(){return this.mul(this)},s.prototype.isqr=function(){return this.imul(this.clone())},s.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),n=0;n>>r}return t}(e);if(0===t.length)return new s(1);for(var n=this,i=0;i=0);var t,n=e%26,r=(e-n)/26,s=67108863>>>26-n<<26-n;if(0!==n){var o=0;for(t=0;t>>26-n}o&&(this.words[t]=o,this.length++)}if(0!==r){for(t=this.length-1;t>=0;t--)this.words[t+r]=this.words[t];for(t=0;t=0),r=t?(t-t%26)/26:0;var s=e%26,o=Math.min((e-s)/26,this.length),a=67108863^67108863>>>s<o)for(this.length-=o,u=0;u=0&&(0!==l||u>=r);u--){var d=0|this.words[u];this.words[u]=l<<26-s|d>>>s,l=d&a}return c&&0!==l&&(c.words[c.length++]=l),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},s.prototype.ishrn=function(e,t,n){return i(0===this.negative),this.iushrn(e,t,n)},s.prototype.shln=function(e){return this.clone().ishln(e)},s.prototype.ushln=function(e){return this.clone().iushln(e)},s.prototype.shrn=function(e){return this.clone().ishrn(e)},s.prototype.ushrn=function(e){return this.clone().iushrn(e)},s.prototype.testn=function(e){i("number"==typeof e&&e>=0);var t=e%26,n=(e-t)/26,r=1<=0);var t=e%26,n=(e-t)/26;if(i(0===this.negative,"imaskn works only with positive numbers"),this.length<=n)return this;if(0!==t&&n++,this.length=Math.min(n,this.length),0!==t){var r=67108863^67108863>>>t<=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},s.prototype.isubn=function(e){if(i("number"==typeof e),i(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t>26)-(c/67108864|0),this.words[r+n]=67108863&s}for(;r>26,this.words[r+n]=67108863&s;if(0===a)return this.strip();for(i(-1===a),a=0,r=0;r>26,this.words[r]=67108863&s;return this.negative=1,this.strip()},s.prototype._wordDiv=function(e,t){var n=(this.length,e.length),i=this.clone(),r=e,o=0|r.words[r.length-1];0!==(n=26-this._countBits(o))&&(r=r.ushln(n),i.iushln(n),o=0|r.words[r.length-1]);var a,c=i.length-r.length;if("mod"!==t){(a=new s(null)).length=c+1,a.words=new Array(a.length);for(var u=0;u=0;d--){var f=67108864*(0|i.words[r.length+d])+(0|i.words[r.length+d-1]);for(f=Math.min(f/o|0,67108863),i._ishlnsubmul(r,f,d);0!==i.negative;)f--,i.negative=0,i._ishlnsubmul(r,1,d),i.isZero()||(i.negative^=1);a&&(a.words[d]=f)}return a&&a.strip(),i.strip(),"div"!==t&&0!==n&&i.iushrn(n),{div:a||null,mod:i}},s.prototype.divmod=function(e,t,n){return i(!e.isZero()),this.isZero()?{div:new s(0),mod:new s(0)}:0!==this.negative&&0===e.negative?(a=this.neg().divmod(e,t),"mod"!==t&&(r=a.div.neg()),"div"!==t&&(o=a.mod.neg(),n&&0!==o.negative&&o.iadd(e)),{div:r,mod:o}):0===this.negative&&0!==e.negative?(a=this.divmod(e.neg(),t),"mod"!==t&&(r=a.div.neg()),{div:r,mod:a.mod}):0!=(this.negative&e.negative)?(a=this.neg().divmod(e.neg(),t),"div"!==t&&(o=a.mod.neg(),n&&0!==o.negative&&o.isub(e)),{div:a.div,mod:o}):e.length>this.length||this.cmp(e)<0?{div:new s(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new s(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new s(this.modn(e.words[0]))}:this._wordDiv(e,t);var r,o,a},s.prototype.div=function(e){return this.divmod(e,"div",!1).div},s.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},s.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},s.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var n=0!==t.div.negative?t.mod.isub(e):t.mod,i=e.ushrn(1),r=e.andln(1),s=n.cmp(i);return s<0||1===r&&0===s?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},s.prototype.modn=function(e){i(e<=67108863);for(var t=(1<<26)%e,n=0,r=this.length-1;r>=0;r--)n=(t*n+(0|this.words[r]))%e;return n},s.prototype.idivn=function(e){i(e<=67108863);for(var t=0,n=this.length-1;n>=0;n--){var r=(0|this.words[n])+67108864*t;this.words[n]=r/e|0,t=r%e}return this.strip()},s.prototype.divn=function(e){return this.clone().idivn(e)},s.prototype.egcd=function(e){i(0===e.negative),i(!e.isZero());var t=this,n=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var r=new s(1),o=new s(0),a=new s(0),c=new s(1),u=0;t.isEven()&&n.isEven();)t.iushrn(1),n.iushrn(1),++u;for(var l=n.clone(),d=t.clone();!t.isZero();){for(var f=0,p=1;0==(t.words[0]&p)&&f<26;++f,p<<=1);if(f>0)for(t.iushrn(f);f-- >0;)(r.isOdd()||o.isOdd())&&(r.iadd(l),o.isub(d)),r.iushrn(1),o.iushrn(1);for(var h=0,m=1;0==(n.words[0]&m)&&h<26;++h,m<<=1);if(h>0)for(n.iushrn(h);h-- >0;)(a.isOdd()||c.isOdd())&&(a.iadd(l),c.isub(d)),a.iushrn(1),c.iushrn(1);t.cmp(n)>=0?(t.isub(n),r.isub(a),o.isub(c)):(n.isub(t),a.isub(r),c.isub(o))}return{a:a,b:c,gcd:n.iushln(u)}},s.prototype._invmp=function(e){i(0===e.negative),i(!e.isZero());var t=this,n=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var r,o=new s(1),a=new s(0),c=n.clone();t.cmpn(1)>0&&n.cmpn(1)>0;){for(var u=0,l=1;0==(t.words[0]&l)&&u<26;++u,l<<=1);if(u>0)for(t.iushrn(u);u-- >0;)o.isOdd()&&o.iadd(c),o.iushrn(1);for(var d=0,f=1;0==(n.words[0]&f)&&d<26;++d,f<<=1);if(d>0)for(n.iushrn(d);d-- >0;)a.isOdd()&&a.iadd(c),a.iushrn(1);t.cmp(n)>=0?(t.isub(n),o.isub(a)):(n.isub(t),a.isub(o))}return(r=0===t.cmpn(1)?o:a).cmpn(0)<0&&r.iadd(e),r},s.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),n=e.clone();t.negative=0,n.negative=0;for(var i=0;t.isEven()&&n.isEven();i++)t.iushrn(1),n.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;n.isEven();)n.iushrn(1);var r=t.cmp(n);if(r<0){var s=t;t=n,n=s}else if(0===r||0===n.cmpn(1))break;t.isub(n)}return n.iushln(i)},s.prototype.invm=function(e){return this.egcd(e).a.umod(e)},s.prototype.isEven=function(){return 0==(1&this.words[0])},s.prototype.isOdd=function(){return 1==(1&this.words[0])},s.prototype.andln=function(e){return this.words[0]&e},s.prototype.bincn=function(e){i("number"==typeof e);var t=e%26,n=(e-t)/26,r=1<>>26,a&=67108863,this.words[o]=a}return 0!==s&&(this.words[o]=s,this.length++),this},s.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},s.prototype.cmpn=function(e){var t,n=e<0;if(0!==this.negative&&!n)return-1;if(0===this.negative&&n)return 1;if(this.strip(),this.length>1)t=1;else{n&&(e=-e),i(e<=67108863,"Number is too big");var r=0|this.words[0];t=r===e?0:re.length)return 1;if(this.length=0;n--){var i=0|this.words[n],r=0|e.words[n];if(i!==r){ir&&(t=1);break}}return t},s.prototype.gtn=function(e){return 1===this.cmpn(e)},s.prototype.gt=function(e){return 1===this.cmp(e)},s.prototype.gten=function(e){return this.cmpn(e)>=0},s.prototype.gte=function(e){return this.cmp(e)>=0},s.prototype.ltn=function(e){return-1===this.cmpn(e)},s.prototype.lt=function(e){return-1===this.cmp(e)},s.prototype.lten=function(e){return this.cmpn(e)<=0},s.prototype.lte=function(e){return this.cmp(e)<=0},s.prototype.eqn=function(e){return 0===this.cmpn(e)},s.prototype.eq=function(e){return 0===this.cmp(e)},s.red=function(e){return new k(e)},s.prototype.toRed=function(e){return i(!this.red,"Already a number in reduction context"),i(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},s.prototype.fromRed=function(){return i(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},s.prototype._forceRed=function(e){return this.red=e,this},s.prototype.forceRed=function(e){return i(!this.red,"Already a number in reduction context"),this._forceRed(e)},s.prototype.redAdd=function(e){return i(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},s.prototype.redIAdd=function(e){return i(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},s.prototype.redSub=function(e){return i(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},s.prototype.redISub=function(e){return i(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},s.prototype.redShl=function(e){return i(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},s.prototype.redMul=function(e){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},s.prototype.redIMul=function(e){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},s.prototype.redSqr=function(){return i(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},s.prototype.redISqr=function(){return i(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},s.prototype.redSqrt=function(){return i(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},s.prototype.redInvm=function(){return i(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},s.prototype.redNeg=function(){return i(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},s.prototype.redPow=function(e){return i(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var g={k256:null,p224:null,p192:null,p25519:null};function v(e,t){this.name=e,this.p=new s(t,16),this.n=this.p.bitLength(),this.k=new s(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function y(){v.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function _(){v.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function w(){v.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function x(){v.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function k(e){if("string"==typeof e){var t=s._prime(e);this.m=t.p,this.prime=t}else i(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function E(e){k.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new s(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}v.prototype._tmp=function(){var e=new s(null);return e.words=new Array(Math.ceil(this.n/13)),e},v.prototype.ireduce=function(e){var t,n=e;do{this.split(n,this.tmp),t=(n=(n=this.imulK(n)).iadd(this.tmp)).bitLength()}while(t>this.n);var i=t0?n.isub(this.p):void 0!==n.strip?n.strip():n._strip(),n},v.prototype.split=function(e,t){e.iushrn(this.n,0,t)},v.prototype.imulK=function(e){return e.imul(this.k)},r(y,v),y.prototype.split=function(e,t){for(var n=4194303,i=Math.min(e.length,9),r=0;r>>22,s=o}s>>>=22,e.words[r-10]=s,0===s&&e.length>10?e.length-=10:e.length-=9},y.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,n=0;n>>=26,e.words[n]=r,t=i}return 0!==t&&(e.words[e.length++]=t),e},s._prime=function(e){if(g[e])return g[e];var t;if("k256"===e)t=new y;else if("p224"===e)t=new _;else if("p192"===e)t=new w;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new x}return g[e]=t,t},k.prototype._verify1=function(e){i(0===e.negative,"red works only with positives"),i(e.red,"red works only with red numbers")},k.prototype._verify2=function(e,t){i(0==(e.negative|t.negative),"red works only with positives"),i(e.red&&e.red===t.red,"red works only with red numbers")},k.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},k.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},k.prototype.add=function(e,t){this._verify2(e,t);var n=e.add(t);return n.cmp(this.m)>=0&&n.isub(this.m),n._forceRed(this)},k.prototype.iadd=function(e,t){this._verify2(e,t);var n=e.iadd(t);return n.cmp(this.m)>=0&&n.isub(this.m),n},k.prototype.sub=function(e,t){this._verify2(e,t);var n=e.sub(t);return n.cmpn(0)<0&&n.iadd(this.m),n._forceRed(this)},k.prototype.isub=function(e,t){this._verify2(e,t);var n=e.isub(t);return n.cmpn(0)<0&&n.iadd(this.m),n},k.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},k.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},k.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},k.prototype.isqr=function(e){return this.imul(e,e.clone())},k.prototype.sqr=function(e){return this.mul(e,e)},k.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(i(t%2==1),3===t){var n=this.m.add(new s(1)).iushrn(2);return this.pow(e,n)}for(var r=this.m.subn(1),o=0;!r.isZero()&&0===r.andln(1);)o++,r.iushrn(1);i(!r.isZero());var a=new s(1).toRed(this),c=a.redNeg(),u=this.m.subn(1).iushrn(1),l=this.m.bitLength();for(l=new s(2*l*l).toRed(this);0!==this.pow(l,u).cmp(c);)l.redIAdd(c);for(var d=this.pow(l,r),f=this.pow(e,r.addn(1).iushrn(1)),p=this.pow(e,r),h=o;0!==p.cmp(a);){for(var m=p,b=0;0!==m.cmp(a);b++)m=m.redSqr();i(b=0;i--){for(var u=t.words[i],l=c-1;l>=0;l--){var d=u>>l&1;r!==n[0]&&(r=this.sqr(r)),0!==d||0!==o?(o<<=1,o|=d,(4===++a||0===i&&0===l)&&(r=this.mul(r,n[o]),a=0,o=0)):a=0}c=26}return r},k.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},k.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},s.mont=function(e){return new E(e)},r(E,k),E.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},E.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},E.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var n=e.imul(t),i=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),r=n.isub(i).iushrn(this.shift),s=r;return r.cmp(this.m)>=0?s=r.isub(this.m):r.cmpn(0)<0&&(s=r.iadd(this.m)),s._forceRed(this)},E.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new s(0)._forceRed(this);var n=e.mul(t),i=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),r=n.isub(i).iushrn(this.shift),o=r;return r.cmp(this.m)>=0?o=r.isub(this.m):r.cmpn(0)<0&&(o=r.iadd(this.m)),o._forceRed(this)},E.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(void 0===t||t,this)},{buffer:73}],19:[function(e,t,n){"use strict";n.byteLength=function(e){var t=u(e),n=t[0],i=t[1];return 3*(n+i)/4-i},n.toByteArray=function(e){var t,n,i=u(e),o=i[0],a=i[1],c=new s(function(e,t,n){return 3*(t+n)/4-n}(0,o,a)),l=0,d=a>0?o-4:o;for(n=0;n>16&255,c[l++]=t>>8&255,c[l++]=255&t;2===a&&(t=r[e.charCodeAt(n)]<<2|r[e.charCodeAt(n+1)]>>4,c[l++]=255&t);1===a&&(t=r[e.charCodeAt(n)]<<10|r[e.charCodeAt(n+1)]<<4|r[e.charCodeAt(n+2)]>>2,c[l++]=t>>8&255,c[l++]=255&t);return c},n.fromByteArray=function(e){for(var t,n=e.length,r=n%3,s=[],o=16383,a=0,c=n-r;ac?c:a+o));1===r?(t=e[n-1],s.push(i[t>>2]+i[t<<4&63]+"==")):2===r&&(t=(e[n-2]<<8)+e[n-1],s.push(i[t>>10]+i[t>>4&63]+i[t<<2&63]+"="));return s.join("")};for(var i=[],r=[],s="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0,c=o.length;a0)throw new Error("Invalid string. Length must be a multiple of 4");var n=e.indexOf("=");return-1===n&&(n=t),[n,n===t?0:4-n%4]}function l(e,t,n){for(var r,s,o=[],a=t;a>18&63]+i[s>>12&63]+i[s>>6&63]+i[63&s]);return o.join("")}r["-".charCodeAt(0)]=62,r["_".charCodeAt(0)]=63},{}],20:[function(e,t,n){(function(e){(function(){function n(e,t,n){let i=0,r=1;for(let s=t;s=48)i=10*i+(n-48);else if(s!==t||43!==n){if(s!==t||45!==n){if(46===n)break;throw new Error("not a number: buffer["+s+"] = "+n)}r=-1}}return i*r}function i(t,n,r,s){return null==t||0===t.length?null:("number"!=typeof n&&null==s&&(s=n,n=void 0),"number"!=typeof r&&null==s&&(s=r,r=void 0),i.position=0,i.encoding=s||null,i.data=e.isBuffer(t)?t.slice(n,r):e.from(t),i.bytes=i.data.length,i.next())}i.bytes=0,i.position=0,i.data=null,i.encoding=null,i.next=function(){switch(i.data[i.position]){case 100:return i.dictionary();case 108:return i.list();case 105:return i.integer();default:return i.buffer()}},i.find=function(e){let t=i.position;const n=i.data.length,r=i.data;for(;t{const r=t.split("-").map((e=>parseInt(e)));return e.concat(((e,t=e)=>Array.from({length:t-e+1},((t,n)=>n+e)))(...r))}),[])}t.exports=i,t.exports.parse=i,t.exports.compose=function(e){return e.reduce(((e,t,n,i)=>(0!==n&&t===i[n-1]+1||e.push([]),e[e.length-1].push(t),e)),[]).map((e=>e.length>1?`${e[0]}-${e[e.length-1]}`:`${e[0]}`))}},{}],26:[function(e,t,n){t.exports=function(e,t,n,i,r){var s,o;if(void 0===i)i=0;else if((i|=0)<0||i>=e.length)throw new RangeError("invalid lower bound");if(void 0===r)r=e.length-1;else if((r|=0)=e.length)throw new RangeError("invalid upper bound");for(;i<=r;)if((o=+n(e[s=i+(r-i>>>1)],t,s,e))<0)i=s+1;else{if(!(o>0))return s;r=s-1}return~i}},{}],27:[function(e,t,n){"use strict";function i(e){var t=e>>3;return e%8!=0&&t++,t}Object.defineProperty(n,"__esModule",{value:!0});var r=function(){function e(e,t){void 0===e&&(e=0);var n=null==t?void 0:t.grow;this.grow=n&&isFinite(n)&&i(n)||n||0,this.buffer="number"==typeof e?new Uint8Array(i(e)):e}return e.prototype.get=function(e){var t=e>>3;return t>e%8)},e.prototype.set=function(e,t){void 0===t&&(t=!0);var n=e>>3;if(t){if(this.buffer.length>e%8}else n>e%8))},e.prototype.forEach=function(e,t,n){void 0===t&&(t=0),void 0===n&&(n=8*this.buffer.length);for(var i=t,r=i>>3,s=128>>i%8,o=this.buffer[r];i>1},e}();n.default=r},{}],28:[function(e,t,n){(function(n){(function(){ +!function e(t,i,n){function r(a,o){if(!i[a]){if(!t[a]){var c="function"==typeof require&&require;if(!o&&c)return c(a,!0);if(s)return s(a,!0);var l=new Error("Cannot find module '"+a+"'");throw l.code="MODULE_NOT_FOUND",l}var u=i[a]={exports:{}};t[a][0].call(u.exports,(function(e){return r(t[a][1][e]||e)}),u,u.exports,e,t,i,n)}return i[a].exports}for(var s="function"==typeof require&&require,a=0;a=0?e.ownerDocument.body:a(e)&&d(e)?e:b(m(e))}function v(e,t){var i;void 0===t&&(t=[]);var r=b(e),s=r===(null==(i=e.ownerDocument)?void 0:i.body),a=n(r),o=s?[a].concat(a.visualViewport||[],d(r)?r:[]):r,c=t.concat(o);return s?c:c.concat(v(m(o)))}function g(e){return["table","td","th"].indexOf(c(e))>=0}function y(e){return a(e)&&"fixed"!==p(e).position?e.offsetParent:null}function _(e){for(var t=n(e),i=y(e);i&&g(i)&&"static"===p(i).position;)i=y(i);return i&&("html"===c(i)||"body"===c(i)&&"static"===p(i).position)?t:i||function(e){var t=-1!==navigator.userAgent.toLowerCase().indexOf("firefox");if(-1!==navigator.userAgent.indexOf("Trident")&&a(e)&&"fixed"===p(e).position)return null;for(var i=m(e);a(i)&&["html","body"].indexOf(c(i))<0;){var n=p(i);if("none"!==n.transform||"none"!==n.perspective||"paint"===n.contain||-1!==["transform","perspective"].indexOf(n.willChange)||t&&"filter"===n.willChange||t&&n.filter&&"none"!==n.filter)return i;i=i.parentNode}return null}(e)||t}Object.defineProperty(i,"__esModule",{value:!0});var x="top",w="bottom",k="right",E="left",S="auto",M=[x,w,k,E],A="start",j="end",I="viewport",T="popper",C=M.reduce((function(e,t){return e.concat([t+"-"+A,t+"-"+j])}),[]),B=[].concat(M,[S]).reduce((function(e,t){return e.concat([t,t+"-"+A,t+"-"+j])}),[]),R=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function L(e){var t=new Map,i=new Set,n=[];function r(e){i.add(e.name),[].concat(e.requires||[],e.requiresIfExists||[]).forEach((function(e){if(!i.has(e)){var n=t.get(e);n&&r(n)}})),n.push(e)}return e.forEach((function(e){t.set(e.name,e)})),e.forEach((function(e){i.has(e.name)||r(e)})),n}function O(e){for(var t=arguments.length,i=new Array(t>1?t-1:0),n=1;n=0&&a(e)?_(e):e;return s(i)?t.filter((function(e){return s(e)&&H(e,i)&&"body"!==c(e)})):[]}(e):[].concat(t),r=[].concat(n,[i]),o=r[0],l=r.reduce((function(t,i){var n=W(e,i);return t.top=N(n.top,t.top),t.right=D(n.right,t.right),t.bottom=D(n.bottom,t.bottom),t.left=N(n.left,t.left),t}),W(e,o));return l.width=l.right-l.left,l.height=l.bottom-l.top,l.x=l.left,l.y=l.top,l}function V(e){return e.split("-")[1]}function $(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function G(e){var t,i=e.reference,n=e.element,r=e.placement,s=r?q(r):null,a=r?V(r):null,o=i.x+i.width/2-n.width/2,c=i.y+i.height/2-n.height/2;switch(s){case x:t={x:o,y:i.y-n.height};break;case w:t={x:o,y:i.y+i.height};break;case k:t={x:i.x+i.width,y:c};break;case E:t={x:i.x-n.width,y:c};break;default:t={x:i.x,y:i.y}}var l=s?$(s):null;if(null!=l){var u="y"===l?"height":"width";switch(a){case A:t[l]=t[l]-(i[u]/2-n[u]/2);break;case j:t[l]=t[l]+(i[u]/2-n[u]/2)}}return t}function X(e){return Object.assign({},{top:0,right:0,bottom:0,left:0},e)}function Y(e,t){return t.reduce((function(t,i){return t[i]=e,t}),{})}function Z(e,i){void 0===i&&(i={});var n=i,r=n.placement,a=void 0===r?e.placement:r,o=n.boundary,c=void 0===o?"clippingParents":o,u=n.rootBoundary,p=void 0===u?I:u,d=n.elementContext,f=void 0===d?T:d,h=n.altBoundary,m=void 0!==h&&h,b=n.padding,v=void 0===b?0:b,g=X("number"!=typeof v?v:Y(v,M)),y=f===T?"reference":T,_=e.rects.popper,E=e.elements[m?y:f],S=K(s(E)?E:E.contextElement||l(e.elements.popper),c,p),A=t(e.elements.reference),j=G({reference:A,element:_,strategy:"absolute",placement:a}),C=F(Object.assign({},_,j)),B=f===T?C:A,R={top:S.top-B.top+g.top,bottom:B.bottom-S.bottom+g.bottom,left:S.left-B.left+g.left,right:B.right-S.right+g.right},L=e.modifiersData.offset;if(f===T&&L){var O=L[a];Object.keys(R).forEach((function(e){var t=[k,w].indexOf(e)>=0?1:-1,i=[x,w].indexOf(e)>=0?"y":"x";R[e]+=O[i]*t}))}return R}var J="Popper: Invalid reference or popper argument provided. They must be either a DOM element or virtual element.",Q={placement:"bottom",modifiers:[],strategy:"absolute"};function ee(){for(var e=arguments.length,t=new Array(e),i=0;i100){console.error("Popper: An infinite loop in the modifiers cycle has been detected! The cycle has been interrupted to prevent a browser crash.");break}if(!0!==l.reset){var a=l.orderedModifiers[s],o=a.fn,c=a.options,u=void 0===c?{}:c,p=a.name;"function"==typeof o&&(l=o({state:l,options:u,name:p,instance:m})||l)}else l.reset=!1,s=-1}}else"production"!==e.env.NODE_ENV&&console.error(J)}},update:(a=function(){return new Promise((function(e){m.forceUpdate(),e(l)}))},function(){return c||(c=new Promise((function(e){Promise.resolve().then((function(){c=void 0,e(a())}))}))),c}),destroy:function(){b(),d=!0}};if(!ee(t,i))return"production"!==e.env.NODE_ENV&&console.error(J),m;function b(){u.forEach((function(e){return e()})),u=[]}return m.setOptions(n).then((function(e){!d&&n.onFirstUpdate&&n.onFirstUpdate(e)})),m}}var ie={passive:!0};var ne={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(e){var t=e.state,i=e.instance,r=e.options,s=r.scroll,a=void 0===s||s,o=r.resize,c=void 0===o||o,l=n(t.elements.popper),u=[].concat(t.scrollParents.reference,t.scrollParents.popper);return a&&u.forEach((function(e){e.addEventListener("scroll",i.update,ie)})),c&&l.addEventListener("resize",i.update,ie),function(){a&&u.forEach((function(e){e.removeEventListener("scroll",i.update,ie)})),c&&l.removeEventListener("resize",i.update,ie)}},data:{}};var re={name:"popperOffsets",enabled:!0,phase:"read",fn:function(e){var t=e.state,i=e.name;t.modifiersData[i]=G({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})},data:{}},se={top:"auto",right:"auto",bottom:"auto",left:"auto"};function ae(e){var t,i=e.popper,r=e.popperRect,s=e.placement,a=e.variation,o=e.offsets,c=e.position,u=e.gpuAcceleration,d=e.adaptive,f=e.roundOffsets,h=!0===f?function(e){var t=e.x,i=e.y,n=window.devicePixelRatio||1;return{x:z(z(t*n)/n)||0,y:z(z(i*n)/n)||0}}(o):"function"==typeof f?f(o):o,m=h.x,b=void 0===m?0:m,v=h.y,g=void 0===v?0:v,y=o.hasOwnProperty("x"),S=o.hasOwnProperty("y"),M=E,A=x,I=window;if(d){var T=_(i),C="clientHeight",B="clientWidth";T===n(i)&&"static"!==p(T=l(i)).position&&"absolute"===c&&(C="scrollHeight",B="scrollWidth"),T=T,s!==x&&(s!==E&&s!==k||a!==j)||(A=w,g-=T[C]-r.height,g*=u?1:-1),s!==E&&(s!==x&&s!==w||a!==j)||(M=k,b-=T[B]-r.width,b*=u?1:-1)}var R,L=Object.assign({position:c},d&&se);return u?Object.assign({},L,((R={})[A]=S?"0":"",R[M]=y?"0":"",R.transform=(I.devicePixelRatio||1)<=1?"translate("+b+"px, "+g+"px)":"translate3d("+b+"px, "+g+"px, 0)",R)):Object.assign({},L,((t={})[A]=S?g+"px":"",t[M]=y?b+"px":"",t.transform="",t))}var oe={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(t){var i=t.state,n=t.options,r=n.gpuAcceleration,s=void 0===r||r,a=n.adaptive,o=void 0===a||a,c=n.roundOffsets,l=void 0===c||c;if("production"!==e.env.NODE_ENV){var u=p(i.elements.popper).transitionProperty||"";o&&["transform","top","right","bottom","left"].some((function(e){return u.indexOf(e)>=0}))&&console.warn(["Popper: Detected CSS transitions on at least one of the following",'CSS properties: "transform", "top", "right", "bottom", "left".',"\n\n",'Disable the "computeStyles" modifier\'s `adaptive` option to allow',"for smooth transitions, or remove these properties from the CSS","transition declaration on the popper element if only transitioning","opacity or background-color for example.","\n\n","We recommend using the popper element as a wrapper around an inner","element that can have any CSS property transitioned for animations."].join(" "))}var d={placement:q(i.placement),variation:V(i.placement),popper:i.elements.popper,popperRect:i.rects.popper,gpuAcceleration:s};null!=i.modifiersData.popperOffsets&&(i.styles.popper=Object.assign({},i.styles.popper,ae(Object.assign({},d,{offsets:i.modifiersData.popperOffsets,position:i.options.strategy,adaptive:o,roundOffsets:l})))),null!=i.modifiersData.arrow&&(i.styles.arrow=Object.assign({},i.styles.arrow,ae(Object.assign({},d,{offsets:i.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),i.attributes.popper=Object.assign({},i.attributes.popper,{"data-popper-placement":i.placement})},data:{}};var ce={name:"applyStyles",enabled:!0,phase:"write",fn:function(e){var t=e.state;Object.keys(t.elements).forEach((function(e){var i=t.styles[e]||{},n=t.attributes[e]||{},r=t.elements[e];a(r)&&c(r)&&(Object.assign(r.style,i),Object.keys(n).forEach((function(e){var t=n[e];!1===t?r.removeAttribute(e):r.setAttribute(e,!0===t?"":t)})))}))},effect:function(e){var t=e.state,i={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,i.popper),t.styles=i,t.elements.arrow&&Object.assign(t.elements.arrow.style,i.arrow),function(){Object.keys(t.elements).forEach((function(e){var n=t.elements[e],r=t.attributes[e]||{},s=Object.keys(t.styles.hasOwnProperty(e)?t.styles[e]:i[e]).reduce((function(e,t){return e[t]="",e}),{});a(n)&&c(n)&&(Object.assign(n.style,s),Object.keys(r).forEach((function(e){n.removeAttribute(e)})))}))}},requires:["computeStyles"]};var le={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(e){var t=e.state,i=e.options,n=e.name,r=i.offset,s=void 0===r?[0,0]:r,a=B.reduce((function(e,i){return e[i]=function(e,t,i){var n=q(e),r=[E,x].indexOf(n)>=0?-1:1,s="function"==typeof i?i(Object.assign({},t,{placement:e})):i,a=s[0],o=s[1];return a=a||0,o=(o||0)*r,[E,k].indexOf(n)>=0?{x:o,y:a}:{x:a,y:o}}(i,t.rects,s),e}),{}),o=a[t.placement],c=o.x,l=o.y;null!=t.modifiersData.popperOffsets&&(t.modifiersData.popperOffsets.x+=c,t.modifiersData.popperOffsets.y+=l),t.modifiersData[n]=a}},ue={left:"right",right:"left",bottom:"top",top:"bottom"};function pe(e){return e.replace(/left|right|bottom|top/g,(function(e){return ue[e]}))}var de={start:"end",end:"start"};function fe(e){return e.replace(/start|end/g,(function(e){return de[e]}))}function he(t,i){void 0===i&&(i={});var n=i,r=n.placement,s=n.boundary,a=n.rootBoundary,o=n.padding,c=n.flipVariations,l=n.allowedAutoPlacements,u=void 0===l?B:l,p=V(r),d=p?c?C:C.filter((function(e){return V(e)===p})):M,f=d.filter((function(e){return u.indexOf(e)>=0}));0===f.length&&(f=d,"production"!==e.env.NODE_ENV&&console.error(["Popper: The `allowedAutoPlacements` option did not allow any","placements. Ensure the `placement` option matches the variation","of the allowed placements.",'For example, "auto" cannot be used to allow "bottom-start".','Use "auto-start" instead.'].join(" ")));var h=f.reduce((function(e,i){return e[i]=Z(t,{placement:i,boundary:s,rootBoundary:a,padding:o})[q(i)],e}),{});return Object.keys(h).sort((function(e,t){return h[e]-h[t]}))}var me={name:"flip",enabled:!0,phase:"main",fn:function(e){var t=e.state,i=e.options,n=e.name;if(!t.modifiersData[n]._skip){for(var r=i.mainAxis,s=void 0===r||r,a=i.altAxis,o=void 0===a||a,c=i.fallbackPlacements,l=i.padding,u=i.boundary,p=i.rootBoundary,d=i.altBoundary,f=i.flipVariations,h=void 0===f||f,m=i.allowedAutoPlacements,b=t.options.placement,v=q(b),g=c||(v===b||!h?[pe(b)]:function(e){if(q(e)===S)return[];var t=pe(e);return[fe(e),t,fe(t)]}(b)),y=[b].concat(g).reduce((function(e,i){return e.concat(q(i)===S?he(t,{placement:i,boundary:u,rootBoundary:p,padding:l,flipVariations:h,allowedAutoPlacements:m}):i)}),[]),_=t.rects.reference,M=t.rects.popper,j=new Map,I=!0,T=y[0],C=0;C=0,P=O?"width":"height",U=Z(t,{placement:B,boundary:u,rootBoundary:p,altBoundary:d,padding:l}),N=O?L?k:E:L?w:x;_[P]>M[P]&&(N=pe(N));var D=pe(N),z=[];if(s&&z.push(U[R]<=0),o&&z.push(U[N]<=0,U[D]<=0),z.every((function(e){return e}))){T=B,I=!1;break}j.set(B,z)}if(I)for(var H=function(e){var t=y.find((function(t){var i=j.get(t);if(i)return i.slice(0,e).every((function(e){return e}))}));if(t)return T=t,"break"},F=h?3:1;F>0;F--){if("break"===H(F))break}t.placement!==T&&(t.modifiersData[n]._skip=!0,t.placement=T,t.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}};function be(e,t,i){return N(e,D(t,i))}var ve={name:"preventOverflow",enabled:!0,phase:"main",fn:function(e){var t=e.state,i=e.options,n=e.name,r=i.mainAxis,s=void 0===r||r,a=i.altAxis,o=void 0!==a&&a,c=i.boundary,l=i.rootBoundary,u=i.altBoundary,p=i.padding,d=i.tether,f=void 0===d||d,m=i.tetherOffset,b=void 0===m?0:m,v=Z(t,{boundary:c,rootBoundary:l,padding:p,altBoundary:u}),g=q(t.placement),y=V(t.placement),S=!y,M=$(g),j="x"===M?"y":"x",I=t.modifiersData.popperOffsets,T=t.rects.reference,C=t.rects.popper,B="function"==typeof b?b(Object.assign({},t.rects,{placement:t.placement})):b,R={x:0,y:0};if(I){if(s||o){var L="y"===M?x:E,O="y"===M?w:k,P="y"===M?"height":"width",U=I[M],z=I[M]+v[L],H=I[M]-v[O],F=f?-C[P]/2:0,W=y===A?T[P]:C[P],K=y===A?-C[P]:-T[P],G=t.elements.arrow,X=f&&G?h(G):{width:0,height:0},Y=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},J=Y[L],Q=Y[O],ee=be(0,T[P],X[P]),te=S?T[P]/2-F-ee-J-B:W-ee-J-B,ie=S?-T[P]/2+F+ee+Q+B:K+ee+Q+B,ne=t.elements.arrow&&_(t.elements.arrow),re=ne?"y"===M?ne.clientTop||0:ne.clientLeft||0:0,se=t.modifiersData.offset?t.modifiersData.offset[t.placement][M]:0,ae=I[M]+te-se-re,oe=I[M]+ie-se;if(s){var ce=be(f?D(z,ae):z,U,f?N(H,oe):H);I[M]=ce,R[M]=ce-U}if(o){var le="x"===M?x:E,ue="x"===M?w:k,pe=I[j],de=pe+v[le],fe=pe-v[ue],he=be(f?D(de,ae):de,pe,f?N(fe,oe):fe);I[j]=he,R[j]=he-pe}}t.modifiersData[n]=R}},requiresIfExists:["offset"]};var ge={name:"arrow",enabled:!0,phase:"main",fn:function(e){var t,i=e.state,n=e.name,r=e.options,s=i.elements.arrow,a=i.modifiersData.popperOffsets,o=q(i.placement),c=$(o),l=[E,k].indexOf(o)>=0?"height":"width";if(s&&a){var u=function(e,t){return X("number"!=typeof(e="function"==typeof e?e(Object.assign({},t.rects,{placement:t.placement})):e)?e:Y(e,M))}(r.padding,i),p=h(s),d="y"===c?x:E,f="y"===c?w:k,m=i.rects.reference[l]+i.rects.reference[c]-a[c]-i.rects.popper[l],b=a[c]-i.rects.reference[c],v=_(s),g=v?"y"===c?v.clientHeight||0:v.clientWidth||0:0,y=m/2-b/2,S=u[d],A=g-p[l]-u[f],j=g/2-p[l]/2+y,I=be(S,j,A),T=c;i.modifiersData[n]=((t={})[T]=I,t.centerOffset=I-j,t)}},effect:function(t){var i=t.state,n=t.options.element,r=void 0===n?"[data-popper-arrow]":n;null!=r&&("string"!=typeof r||(r=i.elements.popper.querySelector(r)))&&("production"!==e.env.NODE_ENV&&(a(r)||console.error(['Popper: "arrow" element must be an HTMLElement (not an SVGElement).',"To use an SVG arrow, wrap it in an HTMLElement that will be used as","the arrow."].join(" "))),H(i.elements.popper,r)?i.elements.arrow=r:"production"!==e.env.NODE_ENV&&console.error(['Popper: "arrow" modifier\'s `element` must be a child of the popper',"element."].join(" ")))},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function ye(e,t,i){return void 0===i&&(i={x:0,y:0}),{top:e.top-t.height-i.y,right:e.right-t.width+i.x,bottom:e.bottom-t.height+i.y,left:e.left-t.width-i.x}}function _e(e){return[x,k,w,E].some((function(t){return e[t]>=0}))}var xe={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(e){var t=e.state,i=e.name,n=t.rects.reference,r=t.rects.popper,s=t.modifiersData.preventOverflow,a=Z(t,{elementContext:"reference"}),o=Z(t,{altBoundary:!0}),c=ye(a,n),l=ye(o,r,s),u=_e(c),p=_e(l);t.modifiersData[i]={referenceClippingOffsets:c,popperEscapeOffsets:l,isReferenceHidden:u,hasPopperEscaped:p},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":u,"data-popper-escaped":p})}},we=te({defaultModifiers:[ne,re,oe,ce]}),ke=[ne,re,oe,ce,le,me,ve,ge,xe],Ee=te({defaultModifiers:ke});i.applyStyles=ce,i.arrow=ge,i.computeStyles=oe,i.createPopper=Ee,i.createPopperLite=we,i.defaultModifiers=ke,i.detectOverflow=Z,i.eventListeners=ne,i.flip=me,i.hide=xe,i.offset=le,i.popperGenerator=te,i.popperOffsets=re,i.preventOverflow=ve}).call(this)}).call(this,e("_process"))},{_process:341}],2:[function(e,t,i){(function(e){(function(){void 0===e&&(e=void 0),function(){"use strict";void 0===e&&(e=Array),t.exports=e}()}).call(this)}).call(this,e("buffer").Buffer)},{buffer:110}],3:[function(e,t,i){const n=/^\[?([^\]]+)]?:(\d+)$/;let r=new Map;t.exports=function(e){if(1e5===r.size&&r.clear(),!r.has(e)){const t=n.exec(e);if(!t)throw new Error(`invalid addr: ${e}`);r.set(e,[t[1],Number(t[2])])}return r.get(e)}},{}],4:[function(e,t,i){"use strict";const n=i;n.bignum=e("bn.js"),n.define=e("./asn1/api").define,n.base=e("./asn1/base"),n.constants=e("./asn1/constants"),n.decoders=e("./asn1/decoders"),n.encoders=e("./asn1/encoders")},{"./asn1/api":5,"./asn1/base":7,"./asn1/constants":11,"./asn1/decoders":13,"./asn1/encoders":16,"bn.js":18}],5:[function(e,t,i){"use strict";const n=e("./encoders"),r=e("./decoders"),s=e("inherits");function a(e,t){this.name=e,this.body=t,this.decoders={},this.encoders={}}i.define=function(e,t){return new a(e,t)},a.prototype._createNamed=function(e){const t=this.name;function i(e){this._initNamed(e,t)}return s(i,e),i.prototype._initNamed=function(t,i){e.call(this,t,i)},new i(this)},a.prototype._getDecoder=function(e){return e=e||"der",this.decoders.hasOwnProperty(e)||(this.decoders[e]=this._createNamed(r[e])),this.decoders[e]},a.prototype.decode=function(e,t,i){return this._getDecoder(t).decode(e,i)},a.prototype._getEncoder=function(e){return e=e||"der",this.encoders.hasOwnProperty(e)||(this.encoders[e]=this._createNamed(n[e])),this.encoders[e]},a.prototype.encode=function(e,t,i){return this._getEncoder(t).encode(e,i)}},{"./decoders":13,"./encoders":16,inherits:246}],6:[function(e,t,i){"use strict";const n=e("inherits"),r=e("../base/reporter").Reporter,s=e("safer-buffer").Buffer;function a(e,t){r.call(this,t),s.isBuffer(e)?(this.base=e,this.offset=0,this.length=e.length):this.error("Input not Buffer")}function o(e,t){if(Array.isArray(e))this.length=0,this.value=e.map((function(e){return o.isEncoderBuffer(e)||(e=new o(e,t)),this.length+=e.length,e}),this);else if("number"==typeof e){if(!(0<=e&&e<=255))return t.error("non-byte EncoderBuffer value");this.value=e,this.length=1}else if("string"==typeof e)this.value=e,this.length=s.byteLength(e);else{if(!s.isBuffer(e))return t.error("Unsupported type: "+typeof e);this.value=e,this.length=e.length}}n(a,r),i.DecoderBuffer=a,a.isDecoderBuffer=function(e){if(e instanceof a)return!0;return"object"==typeof e&&s.isBuffer(e.base)&&"DecoderBuffer"===e.constructor.name&&"number"==typeof e.offset&&"number"==typeof e.length&&"function"==typeof e.save&&"function"==typeof e.restore&&"function"==typeof e.isEmpty&&"function"==typeof e.readUInt8&&"function"==typeof e.skip&&"function"==typeof e.raw},a.prototype.save=function(){return{offset:this.offset,reporter:r.prototype.save.call(this)}},a.prototype.restore=function(e){const t=new a(this.base);return t.offset=e.offset,t.length=this.offset,this.offset=e.offset,r.prototype.restore.call(this,e.reporter),t},a.prototype.isEmpty=function(){return this.offset===this.length},a.prototype.readUInt8=function(e){return this.offset+1<=this.length?this.base.readUInt8(this.offset++,!0):this.error(e||"DecoderBuffer overrun")},a.prototype.skip=function(e,t){if(!(this.offset+e<=this.length))return this.error(t||"DecoderBuffer overrun");const i=new a(this.base);return i._reporterState=this._reporterState,i.offset=this.offset,i.length=this.offset+e,this.offset+=e,i},a.prototype.raw=function(e){return this.base.slice(e?e.offset:this.offset,this.length)},i.EncoderBuffer=o,o.isEncoderBuffer=function(e){if(e instanceof o)return!0;return"object"==typeof e&&"EncoderBuffer"===e.constructor.name&&"number"==typeof e.length&&"function"==typeof e.join},o.prototype.join=function(e,t){return e||(e=s.alloc(this.length)),t||(t=0),0===this.length||(Array.isArray(this.value)?this.value.forEach((function(i){i.join(e,t),t+=i.length})):("number"==typeof this.value?e[t]=this.value:"string"==typeof this.value?e.write(this.value,t):s.isBuffer(this.value)&&this.value.copy(e,t),t+=this.length)),e}},{"../base/reporter":9,inherits:246,"safer-buffer":384}],7:[function(e,t,i){"use strict";const n=i;n.Reporter=e("./reporter").Reporter,n.DecoderBuffer=e("./buffer").DecoderBuffer,n.EncoderBuffer=e("./buffer").EncoderBuffer,n.Node=e("./node")},{"./buffer":6,"./node":8,"./reporter":9}],8:[function(e,t,i){"use strict";const n=e("../base/reporter").Reporter,r=e("../base/buffer").EncoderBuffer,s=e("../base/buffer").DecoderBuffer,a=e("minimalistic-assert"),o=["seq","seqof","set","setof","objid","bool","gentime","utctime","null_","enum","int","objDesc","bitstr","bmpstr","charstr","genstr","graphstr","ia5str","iso646str","numstr","octstr","printstr","t61str","unistr","utf8str","videostr"],c=["key","obj","use","optional","explicit","implicit","def","choice","any","contains"].concat(o);function l(e,t,i){const n={};this._baseState=n,n.name=i,n.enc=e,n.parent=t||null,n.children=null,n.tag=null,n.args=null,n.reverseArgs=null,n.choice=null,n.optional=!1,n.any=!1,n.obj=!1,n.use=null,n.useDecoder=null,n.key=null,n.default=null,n.explicit=null,n.implicit=null,n.contains=null,n.parent||(n.children=[],this._wrap())}t.exports=l;const u=["enc","parent","children","tag","args","reverseArgs","choice","optional","any","obj","use","alteredUse","key","default","explicit","implicit","contains"];l.prototype.clone=function(){const e=this._baseState,t={};u.forEach((function(i){t[i]=e[i]}));const i=new this.constructor(t.parent);return i._baseState=t,i},l.prototype._wrap=function(){const e=this._baseState;c.forEach((function(t){this[t]=function(){const i=new this.constructor(this);return e.children.push(i),i[t].apply(i,arguments)}}),this)},l.prototype._init=function(e){const t=this._baseState;a(null===t.parent),e.call(this),t.children=t.children.filter((function(e){return e._baseState.parent===this}),this),a.equal(t.children.length,1,"Root node can have only one child")},l.prototype._useArgs=function(e){const t=this._baseState,i=e.filter((function(e){return e instanceof this.constructor}),this);e=e.filter((function(e){return!(e instanceof this.constructor)}),this),0!==i.length&&(a(null===t.children),t.children=i,i.forEach((function(e){e._baseState.parent=this}),this)),0!==e.length&&(a(null===t.args),t.args=e,t.reverseArgs=e.map((function(e){if("object"!=typeof e||e.constructor!==Object)return e;const t={};return Object.keys(e).forEach((function(i){i==(0|i)&&(i|=0);const n=e[i];t[n]=i})),t})))},["_peekTag","_decodeTag","_use","_decodeStr","_decodeObjid","_decodeTime","_decodeNull","_decodeInt","_decodeBool","_decodeList","_encodeComposite","_encodeStr","_encodeObjid","_encodeTime","_encodeNull","_encodeInt","_encodeBool"].forEach((function(e){l.prototype[e]=function(){const t=this._baseState;throw new Error(e+" not implemented for encoding: "+t.enc)}})),o.forEach((function(e){l.prototype[e]=function(){const t=this._baseState,i=Array.prototype.slice.call(arguments);return a(null===t.tag),t.tag=e,this._useArgs(i),this}})),l.prototype.use=function(e){a(e);const t=this._baseState;return a(null===t.use),t.use=e,this},l.prototype.optional=function(){return this._baseState.optional=!0,this},l.prototype.def=function(e){const t=this._baseState;return a(null===t.default),t.default=e,t.optional=!0,this},l.prototype.explicit=function(e){const t=this._baseState;return a(null===t.explicit&&null===t.implicit),t.explicit=e,this},l.prototype.implicit=function(e){const t=this._baseState;return a(null===t.explicit&&null===t.implicit),t.implicit=e,this},l.prototype.obj=function(){const e=this._baseState,t=Array.prototype.slice.call(arguments);return e.obj=!0,0!==t.length&&this._useArgs(t),this},l.prototype.key=function(e){const t=this._baseState;return a(null===t.key),t.key=e,this},l.prototype.any=function(){return this._baseState.any=!0,this},l.prototype.choice=function(e){const t=this._baseState;return a(null===t.choice),t.choice=e,this._useArgs(Object.keys(e).map((function(t){return e[t]}))),this},l.prototype.contains=function(e){const t=this._baseState;return a(null===t.use),t.contains=e,this},l.prototype._decode=function(e,t){const i=this._baseState;if(null===i.parent)return e.wrapResult(i.children[0]._decode(e,t));let n,r=i.default,a=!0,o=null;if(null!==i.key&&(o=e.enterKey(i.key)),i.optional){let n=null;if(null!==i.explicit?n=i.explicit:null!==i.implicit?n=i.implicit:null!==i.tag&&(n=i.tag),null!==n||i.any){if(a=this._peekTag(e,n,i.any),e.isError(a))return a}else{const n=e.save();try{null===i.choice?this._decodeGeneric(i.tag,e,t):this._decodeChoice(e,t),a=!0}catch(e){a=!1}e.restore(n)}}if(i.obj&&a&&(n=e.enterObject()),a){if(null!==i.explicit){const t=this._decodeTag(e,i.explicit);if(e.isError(t))return t;e=t}const n=e.offset;if(null===i.use&&null===i.choice){let t;i.any&&(t=e.save());const n=this._decodeTag(e,null!==i.implicit?i.implicit:i.tag,i.any);if(e.isError(n))return n;i.any?r=e.raw(t):e=n}if(t&&t.track&&null!==i.tag&&t.track(e.path(),n,e.length,"tagged"),t&&t.track&&null!==i.tag&&t.track(e.path(),e.offset,e.length,"content"),i.any||(r=null===i.choice?this._decodeGeneric(i.tag,e,t):this._decodeChoice(e,t)),e.isError(r))return r;if(i.any||null!==i.choice||null===i.children||i.children.forEach((function(i){i._decode(e,t)})),i.contains&&("octstr"===i.tag||"bitstr"===i.tag)){const n=new s(r);r=this._getUse(i.contains,e._reporterState.obj)._decode(n,t)}}return i.obj&&a&&(r=e.leaveObject(n)),null===i.key||null===r&&!0!==a?null!==o&&e.exitKey(o):e.leaveKey(o,i.key,r),r},l.prototype._decodeGeneric=function(e,t,i){const n=this._baseState;return"seq"===e||"set"===e?null:"seqof"===e||"setof"===e?this._decodeList(t,e,n.args[0],i):/str$/.test(e)?this._decodeStr(t,e,i):"objid"===e&&n.args?this._decodeObjid(t,n.args[0],n.args[1],i):"objid"===e?this._decodeObjid(t,null,null,i):"gentime"===e||"utctime"===e?this._decodeTime(t,e,i):"null_"===e?this._decodeNull(t,i):"bool"===e?this._decodeBool(t,i):"objDesc"===e?this._decodeStr(t,e,i):"int"===e||"enum"===e?this._decodeInt(t,n.args&&n.args[0],i):null!==n.use?this._getUse(n.use,t._reporterState.obj)._decode(t,i):t.error("unknown tag: "+e)},l.prototype._getUse=function(e,t){const i=this._baseState;return i.useDecoder=this._use(e,t),a(null===i.useDecoder._baseState.parent),i.useDecoder=i.useDecoder._baseState.children[0],i.implicit!==i.useDecoder._baseState.implicit&&(i.useDecoder=i.useDecoder.clone(),i.useDecoder._baseState.implicit=i.implicit),i.useDecoder},l.prototype._decodeChoice=function(e,t){const i=this._baseState;let n=null,r=!1;return Object.keys(i.choice).some((function(s){const a=e.save(),o=i.choice[s];try{const i=o._decode(e,t);if(e.isError(i))return!1;n={type:s,value:i},r=!0}catch(t){return e.restore(a),!1}return!0}),this),r?n:e.error("Choice not matched")},l.prototype._createEncoderBuffer=function(e){return new r(e,this.reporter)},l.prototype._encode=function(e,t,i){const n=this._baseState;if(null!==n.default&&n.default===e)return;const r=this._encodeValue(e,t,i);return void 0===r||this._skipDefault(r,t,i)?void 0:r},l.prototype._encodeValue=function(e,t,i){const r=this._baseState;if(null===r.parent)return r.children[0]._encode(e,t||new n);let s=null;if(this.reporter=t,r.optional&&void 0===e){if(null===r.default)return;e=r.default}let a=null,o=!1;if(r.any)s=this._createEncoderBuffer(e);else if(r.choice)s=this._encodeChoice(e,t);else if(r.contains)a=this._getUse(r.contains,i)._encode(e,t),o=!0;else if(r.children)a=r.children.map((function(i){if("null_"===i._baseState.tag)return i._encode(null,t,e);if(null===i._baseState.key)return t.error("Child should have a key");const n=t.enterKey(i._baseState.key);if("object"!=typeof e)return t.error("Child expected, but input is not object");const r=i._encode(e[i._baseState.key],t,e);return t.leaveKey(n),r}),this).filter((function(e){return e})),a=this._createEncoderBuffer(a);else if("seqof"===r.tag||"setof"===r.tag){if(!r.args||1!==r.args.length)return t.error("Too many args for : "+r.tag);if(!Array.isArray(e))return t.error("seqof/setof, but data is not Array");const i=this.clone();i._baseState.implicit=null,a=this._createEncoderBuffer(e.map((function(i){const n=this._baseState;return this._getUse(n.args[0],e)._encode(i,t)}),i))}else null!==r.use?s=this._getUse(r.use,i)._encode(e,t):(a=this._encodePrimitive(r.tag,e),o=!0);if(!r.any&&null===r.choice){const e=null!==r.implicit?r.implicit:r.tag,i=null===r.implicit?"universal":"context";null===e?null===r.use&&t.error("Tag could be omitted only for .use()"):null===r.use&&(s=this._encodeComposite(e,o,i,a))}return null!==r.explicit&&(s=this._encodeComposite(r.explicit,!1,"context",s)),s},l.prototype._encodeChoice=function(e,t){const i=this._baseState,n=i.choice[e.type];return n||a(!1,e.type+" not found in "+JSON.stringify(Object.keys(i.choice))),n._encode(e.value,t)},l.prototype._encodePrimitive=function(e,t){const i=this._baseState;if(/str$/.test(e))return this._encodeStr(t,e);if("objid"===e&&i.args)return this._encodeObjid(t,i.reverseArgs[0],i.args[1]);if("objid"===e)return this._encodeObjid(t,null,null);if("gentime"===e||"utctime"===e)return this._encodeTime(t,e);if("null_"===e)return this._encodeNull();if("int"===e||"enum"===e)return this._encodeInt(t,i.args&&i.reverseArgs[0]);if("bool"===e)return this._encodeBool(t);if("objDesc"===e)return this._encodeStr(t,e);throw new Error("Unsupported tag: "+e)},l.prototype._isNumstr=function(e){return/^[0-9 ]*$/.test(e)},l.prototype._isPrintstr=function(e){return/^[A-Za-z0-9 '()+,-./:=?]*$/.test(e)}},{"../base/buffer":6,"../base/reporter":9,"minimalistic-assert":285}],9:[function(e,t,i){"use strict";const n=e("inherits");function r(e){this._reporterState={obj:null,path:[],options:e||{},errors:[]}}function s(e,t){this.path=e,this.rethrow(t)}i.Reporter=r,r.prototype.isError=function(e){return e instanceof s},r.prototype.save=function(){const e=this._reporterState;return{obj:e.obj,pathLen:e.path.length}},r.prototype.restore=function(e){const t=this._reporterState;t.obj=e.obj,t.path=t.path.slice(0,e.pathLen)},r.prototype.enterKey=function(e){return this._reporterState.path.push(e)},r.prototype.exitKey=function(e){const t=this._reporterState;t.path=t.path.slice(0,e-1)},r.prototype.leaveKey=function(e,t,i){const n=this._reporterState;this.exitKey(e),null!==n.obj&&(n.obj[t]=i)},r.prototype.path=function(){return this._reporterState.path.join("/")},r.prototype.enterObject=function(){const e=this._reporterState,t=e.obj;return e.obj={},t},r.prototype.leaveObject=function(e){const t=this._reporterState,i=t.obj;return t.obj=e,i},r.prototype.error=function(e){let t;const i=this._reporterState,n=e instanceof s;if(t=n?e:new s(i.path.map((function(e){return"["+JSON.stringify(e)+"]"})).join(""),e.message||e,e.stack),!i.options.partial)throw t;return n||i.errors.push(t),t},r.prototype.wrapResult=function(e){const t=this._reporterState;return t.options.partial?{result:this.isError(e)?null:e,errors:t.errors}:e},n(s,Error),s.prototype.rethrow=function(e){if(this.message=e+" at: "+(this.path||"(shallow)"),Error.captureStackTrace&&Error.captureStackTrace(this,s),!this.stack)try{throw new Error(this.message)}catch(e){this.stack=e.stack}return this}},{inherits:246}],10:[function(e,t,i){"use strict";function n(e){const t={};return Object.keys(e).forEach((function(i){(0|i)==i&&(i|=0);const n=e[i];t[n]=i})),t}i.tagClass={0:"universal",1:"application",2:"context",3:"private"},i.tagClassByName=n(i.tagClass),i.tag={0:"end",1:"bool",2:"int",3:"bitstr",4:"octstr",5:"null_",6:"objid",7:"objDesc",8:"external",9:"real",10:"enum",11:"embed",12:"utf8str",13:"relativeOid",16:"seq",17:"set",18:"numstr",19:"printstr",20:"t61str",21:"videostr",22:"ia5str",23:"utctime",24:"gentime",25:"graphstr",26:"iso646str",27:"genstr",28:"unistr",29:"charstr",30:"bmpstr"},i.tagByName=n(i.tag)},{}],11:[function(e,t,i){"use strict";const n=i;n._reverse=function(e){const t={};return Object.keys(e).forEach((function(i){(0|i)==i&&(i|=0);const n=e[i];t[n]=i})),t},n.der=e("./der")},{"./der":10}],12:[function(e,t,i){"use strict";const n=e("inherits"),r=e("bn.js"),s=e("../base/buffer").DecoderBuffer,a=e("../base/node"),o=e("../constants/der");function c(e){this.enc="der",this.name=e.name,this.entity=e,this.tree=new l,this.tree._init(e.body)}function l(e){a.call(this,"der",e)}function u(e,t){let i=e.readUInt8(t);if(e.isError(i))return i;const n=o.tagClass[i>>6],r=0==(32&i);if(31==(31&i)){let n=i;for(i=0;128==(128&n);){if(n=e.readUInt8(t),e.isError(n))return n;i<<=7,i|=127&n}}else i&=31;return{cls:n,primitive:r,tag:i,tagStr:o.tag[i]}}function p(e,t,i){let n=e.readUInt8(i);if(e.isError(n))return n;if(!t&&128===n)return null;if(0==(128&n))return n;const r=127&n;if(r>4)return e.error("length octect is too long");n=0;for(let t=0;t=31)return n.error("Multi-octet tag encoding unsupported");t||(r|=32);return r|=a.tagClassByName[i||"universal"]<<6,r}(e,t,i,this.reporter);if(n.length<128){const e=r.alloc(2);return e[0]=s,e[1]=n.length,this._createEncoderBuffer([e,n])}let o=1;for(let e=n.length;e>=256;e>>=8)o++;const c=r.alloc(2+o);c[0]=s,c[1]=128|o;for(let e=1+o,t=n.length;t>0;e--,t>>=8)c[e]=255&t;return this._createEncoderBuffer([c,n])},c.prototype._encodeStr=function(e,t){if("bitstr"===t)return this._createEncoderBuffer([0|e.unused,e.data]);if("bmpstr"===t){const t=r.alloc(2*e.length);for(let i=0;i=40)return this.reporter.error("Second objid identifier OOB");e.splice(0,2,40*e[0]+e[1])}let n=0;for(let t=0;t=128;i>>=7)n++}const s=r.alloc(n);let a=s.length-1;for(let t=e.length-1;t>=0;t--){let i=e[t];for(s[a--]=127&i;(i>>=7)>0;)s[a--]=128|127&i}return this._createEncoderBuffer(s)},c.prototype._encodeTime=function(e,t){let i;const n=new Date(e);return"gentime"===t?i=[l(n.getUTCFullYear()),l(n.getUTCMonth()+1),l(n.getUTCDate()),l(n.getUTCHours()),l(n.getUTCMinutes()),l(n.getUTCSeconds()),"Z"].join(""):"utctime"===t?i=[l(n.getUTCFullYear()%100),l(n.getUTCMonth()+1),l(n.getUTCDate()),l(n.getUTCHours()),l(n.getUTCMinutes()),l(n.getUTCSeconds()),"Z"].join(""):this.reporter.error("Encoding "+t+" time is not supported yet"),this._encodeStr(i,"octstr")},c.prototype._encodeNull=function(){return this._createEncoderBuffer("")},c.prototype._encodeInt=function(e,t){if("string"==typeof e){if(!t)return this.reporter.error("String int or enum given, but no values map");if(!t.hasOwnProperty(e))return this.reporter.error("Values map doesn't contain: "+JSON.stringify(e));e=t[e]}if("number"!=typeof e&&!r.isBuffer(e)){const t=e.toArray();!e.sign&&128&t[0]&&t.unshift(0),e=r.from(t)}if(r.isBuffer(e)){let t=e.length;0===e.length&&t++;const i=r.alloc(t);return e.copy(i),0===e.length&&(i[0]=0),this._createEncoderBuffer(i)}if(e<128)return this._createEncoderBuffer(e);if(e<256)return this._createEncoderBuffer([0,e]);let i=1;for(let t=e;t>=256;t>>=8)i++;const n=new Array(i);for(let t=n.length-1;t>=0;t--)n[t]=255&e,e>>=8;return 128&n[0]&&n.unshift(0),this._createEncoderBuffer(r.from(n))},c.prototype._encodeBool=function(e){return this._createEncoderBuffer(e?255:0)},c.prototype._use=function(e,t){return"function"==typeof e&&(e=e(t)),e._getEncoder("der").tree},c.prototype._skipDefault=function(e,t,i){const n=this._baseState;let r;if(null===n.default)return!1;const s=e.join();if(void 0===n.defaultBuffer&&(n.defaultBuffer=this._encodeValue(n.default,t,i).join()),s.length!==n.defaultBuffer.length)return!1;for(r=0;r=65&&i<=70?i-55:i>=97&&i<=102?i-87:i-48&15}function c(e,t,i){var n=o(e,i);return i-1>=t&&(n|=o(e,i-1)<<4),n}function l(e,t,i,n){for(var r=0,s=Math.min(e.length,i),a=t;a=49?o-49+10:o>=17?o-17+10:o}return r}s.isBN=function(e){return e instanceof s||null!==e&&"object"==typeof e&&e.constructor.wordSize===s.wordSize&&Array.isArray(e.words)},s.max=function(e,t){return e.cmp(t)>0?e:t},s.min=function(e,t){return e.cmp(t)<0?e:t},s.prototype._init=function(e,t,i){if("number"==typeof e)return this._initNumber(e,t,i);if("object"==typeof e)return this._initArray(e,t,i);"hex"===t&&(t=16),n(t===(0|t)&&t>=2&&t<=36);var r=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(r++,this.negative=1),r=0;r-=3)a=e[r]|e[r-1]<<8|e[r-2]<<16,this.words[s]|=a<>>26-o&67108863,(o+=24)>=26&&(o-=26,s++);else if("le"===i)for(r=0,s=0;r>>26-o&67108863,(o+=24)>=26&&(o-=26,s++);return this.strip()},s.prototype._parseHex=function(e,t,i){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var n=0;n=t;n-=2)r=c(e,t,n)<=18?(s-=18,a+=1,this.words[a]|=r>>>26):s+=8;else for(n=(e.length-t)%2==0?t+1:t;n=18?(s-=18,a+=1,this.words[a]|=r>>>26):s+=8;this.strip()},s.prototype._parseBase=function(e,t,i){this.words=[0],this.length=1;for(var n=0,r=1;r<=67108863;r*=t)n++;n--,r=r/t|0;for(var s=e.length-i,a=s%n,o=Math.min(s,s-a)+i,c=0,u=i;u1&&0===this.words[this.length-1];)this.length--;return this._normSign()},s.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},s.prototype.inspect=function(){return(this.red?""};var u=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],p=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],d=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function f(e,t,i){i.negative=t.negative^e.negative;var n=e.length+t.length|0;i.length=n,n=n-1|0;var r=0|e.words[0],s=0|t.words[0],a=r*s,o=67108863&a,c=a/67108864|0;i.words[0]=o;for(var l=1;l>>26,p=67108863&c,d=Math.min(l,t.length-1),f=Math.max(0,l-e.length+1);f<=d;f++){var h=l-f|0;u+=(a=(r=0|e.words[h])*(s=0|t.words[f])+p)/67108864|0,p=67108863&a}i.words[l]=0|p,c=0|u}return 0!==c?i.words[l]=0|c:i.length--,i.strip()}s.prototype.toString=function(e,t){var i;if(t=0|t||1,16===(e=e||10)||"hex"===e){i="";for(var r=0,s=0,a=0;a>>24-r&16777215)||a!==this.length-1?u[6-c.length]+c+i:c+i,(r+=2)>=26&&(r-=26,a--)}for(0!==s&&(i=s.toString(16)+i);i.length%t!=0;)i="0"+i;return 0!==this.negative&&(i="-"+i),i}if(e===(0|e)&&e>=2&&e<=36){var l=p[e],f=d[e];i="";var h=this.clone();for(h.negative=0;!h.isZero();){var m=h.modn(f).toString(e);i=(h=h.idivn(f)).isZero()?m+i:u[l-m.length]+m+i}for(this.isZero()&&(i="0"+i);i.length%t!=0;)i="0"+i;return 0!==this.negative&&(i="-"+i),i}n(!1,"Base should be between 2 and 36")},s.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},s.prototype.toJSON=function(){return this.toString(16)},s.prototype.toBuffer=function(e,t){return n(void 0!==a),this.toArrayLike(a,e,t)},s.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},s.prototype.toArrayLike=function(e,t,i){var r=this.byteLength(),s=i||Math.max(1,r);n(r<=s,"byte array longer than desired length"),n(s>0,"Requested array length <= 0"),this.strip();var a,o,c="le"===t,l=new e(s),u=this.clone();if(c){for(o=0;!u.isZero();o++)a=u.andln(255),u.iushrn(8),l[o]=a;for(;o=4096&&(i+=13,t>>>=13),t>=64&&(i+=7,t>>>=7),t>=8&&(i+=4,t>>>=4),t>=2&&(i+=2,t>>>=2),i+t},s.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,i=0;return 0==(8191&t)&&(i+=13,t>>>=13),0==(127&t)&&(i+=7,t>>>=7),0==(15&t)&&(i+=4,t>>>=4),0==(3&t)&&(i+=2,t>>>=2),0==(1&t)&&i++,i},s.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},s.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},s.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},s.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var i=0;ie.length?this.clone().iand(e):e.clone().iand(this)},s.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},s.prototype.iuxor=function(e){var t,i;this.length>e.length?(t=this,i=e):(t=e,i=this);for(var n=0;ne.length?this.clone().ixor(e):e.clone().ixor(this)},s.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},s.prototype.inotn=function(e){n("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),i=e%26;this._expand(t),i>0&&t--;for(var r=0;r0&&(this.words[r]=~this.words[r]&67108863>>26-i),this.strip()},s.prototype.notn=function(e){return this.clone().inotn(e)},s.prototype.setn=function(e,t){n("number"==typeof e&&e>=0);var i=e/26|0,r=e%26;return this._expand(i+1),this.words[i]=t?this.words[i]|1<e.length?(i=this,n=e):(i=e,n=this);for(var r=0,s=0;s>>26;for(;0!==r&&s>>26;if(this.length=i.length,0!==r)this.words[this.length]=r,this.length++;else if(i!==this)for(;se.length?this.clone().iadd(e):e.clone().iadd(this)},s.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var i,n,r=this.cmp(e);if(0===r)return this.negative=0,this.length=1,this.words[0]=0,this;r>0?(i=this,n=e):(i=e,n=this);for(var s=0,a=0;a>26,this.words[a]=67108863&t;for(;0!==s&&a>26,this.words[a]=67108863&t;if(0===s&&a>>13,f=0|a[1],h=8191&f,m=f>>>13,b=0|a[2],v=8191&b,g=b>>>13,y=0|a[3],_=8191&y,x=y>>>13,w=0|a[4],k=8191&w,E=w>>>13,S=0|a[5],M=8191&S,A=S>>>13,j=0|a[6],I=8191&j,T=j>>>13,C=0|a[7],B=8191&C,R=C>>>13,L=0|a[8],O=8191&L,P=L>>>13,U=0|a[9],q=8191&U,N=U>>>13,D=0|o[0],z=8191&D,H=D>>>13,F=0|o[1],W=8191&F,K=F>>>13,V=0|o[2],$=8191&V,G=V>>>13,X=0|o[3],Y=8191&X,Z=X>>>13,J=0|o[4],Q=8191&J,ee=J>>>13,te=0|o[5],ie=8191&te,ne=te>>>13,re=0|o[6],se=8191&re,ae=re>>>13,oe=0|o[7],ce=8191&oe,le=oe>>>13,ue=0|o[8],pe=8191&ue,de=ue>>>13,fe=0|o[9],he=8191&fe,me=fe>>>13;i.negative=e.negative^t.negative,i.length=19;var be=(l+(n=Math.imul(p,z))|0)+((8191&(r=(r=Math.imul(p,H))+Math.imul(d,z)|0))<<13)|0;l=((s=Math.imul(d,H))+(r>>>13)|0)+(be>>>26)|0,be&=67108863,n=Math.imul(h,z),r=(r=Math.imul(h,H))+Math.imul(m,z)|0,s=Math.imul(m,H);var ve=(l+(n=n+Math.imul(p,W)|0)|0)+((8191&(r=(r=r+Math.imul(p,K)|0)+Math.imul(d,W)|0))<<13)|0;l=((s=s+Math.imul(d,K)|0)+(r>>>13)|0)+(ve>>>26)|0,ve&=67108863,n=Math.imul(v,z),r=(r=Math.imul(v,H))+Math.imul(g,z)|0,s=Math.imul(g,H),n=n+Math.imul(h,W)|0,r=(r=r+Math.imul(h,K)|0)+Math.imul(m,W)|0,s=s+Math.imul(m,K)|0;var ge=(l+(n=n+Math.imul(p,$)|0)|0)+((8191&(r=(r=r+Math.imul(p,G)|0)+Math.imul(d,$)|0))<<13)|0;l=((s=s+Math.imul(d,G)|0)+(r>>>13)|0)+(ge>>>26)|0,ge&=67108863,n=Math.imul(_,z),r=(r=Math.imul(_,H))+Math.imul(x,z)|0,s=Math.imul(x,H),n=n+Math.imul(v,W)|0,r=(r=r+Math.imul(v,K)|0)+Math.imul(g,W)|0,s=s+Math.imul(g,K)|0,n=n+Math.imul(h,$)|0,r=(r=r+Math.imul(h,G)|0)+Math.imul(m,$)|0,s=s+Math.imul(m,G)|0;var ye=(l+(n=n+Math.imul(p,Y)|0)|0)+((8191&(r=(r=r+Math.imul(p,Z)|0)+Math.imul(d,Y)|0))<<13)|0;l=((s=s+Math.imul(d,Z)|0)+(r>>>13)|0)+(ye>>>26)|0,ye&=67108863,n=Math.imul(k,z),r=(r=Math.imul(k,H))+Math.imul(E,z)|0,s=Math.imul(E,H),n=n+Math.imul(_,W)|0,r=(r=r+Math.imul(_,K)|0)+Math.imul(x,W)|0,s=s+Math.imul(x,K)|0,n=n+Math.imul(v,$)|0,r=(r=r+Math.imul(v,G)|0)+Math.imul(g,$)|0,s=s+Math.imul(g,G)|0,n=n+Math.imul(h,Y)|0,r=(r=r+Math.imul(h,Z)|0)+Math.imul(m,Y)|0,s=s+Math.imul(m,Z)|0;var _e=(l+(n=n+Math.imul(p,Q)|0)|0)+((8191&(r=(r=r+Math.imul(p,ee)|0)+Math.imul(d,Q)|0))<<13)|0;l=((s=s+Math.imul(d,ee)|0)+(r>>>13)|0)+(_e>>>26)|0,_e&=67108863,n=Math.imul(M,z),r=(r=Math.imul(M,H))+Math.imul(A,z)|0,s=Math.imul(A,H),n=n+Math.imul(k,W)|0,r=(r=r+Math.imul(k,K)|0)+Math.imul(E,W)|0,s=s+Math.imul(E,K)|0,n=n+Math.imul(_,$)|0,r=(r=r+Math.imul(_,G)|0)+Math.imul(x,$)|0,s=s+Math.imul(x,G)|0,n=n+Math.imul(v,Y)|0,r=(r=r+Math.imul(v,Z)|0)+Math.imul(g,Y)|0,s=s+Math.imul(g,Z)|0,n=n+Math.imul(h,Q)|0,r=(r=r+Math.imul(h,ee)|0)+Math.imul(m,Q)|0,s=s+Math.imul(m,ee)|0;var xe=(l+(n=n+Math.imul(p,ie)|0)|0)+((8191&(r=(r=r+Math.imul(p,ne)|0)+Math.imul(d,ie)|0))<<13)|0;l=((s=s+Math.imul(d,ne)|0)+(r>>>13)|0)+(xe>>>26)|0,xe&=67108863,n=Math.imul(I,z),r=(r=Math.imul(I,H))+Math.imul(T,z)|0,s=Math.imul(T,H),n=n+Math.imul(M,W)|0,r=(r=r+Math.imul(M,K)|0)+Math.imul(A,W)|0,s=s+Math.imul(A,K)|0,n=n+Math.imul(k,$)|0,r=(r=r+Math.imul(k,G)|0)+Math.imul(E,$)|0,s=s+Math.imul(E,G)|0,n=n+Math.imul(_,Y)|0,r=(r=r+Math.imul(_,Z)|0)+Math.imul(x,Y)|0,s=s+Math.imul(x,Z)|0,n=n+Math.imul(v,Q)|0,r=(r=r+Math.imul(v,ee)|0)+Math.imul(g,Q)|0,s=s+Math.imul(g,ee)|0,n=n+Math.imul(h,ie)|0,r=(r=r+Math.imul(h,ne)|0)+Math.imul(m,ie)|0,s=s+Math.imul(m,ne)|0;var we=(l+(n=n+Math.imul(p,se)|0)|0)+((8191&(r=(r=r+Math.imul(p,ae)|0)+Math.imul(d,se)|0))<<13)|0;l=((s=s+Math.imul(d,ae)|0)+(r>>>13)|0)+(we>>>26)|0,we&=67108863,n=Math.imul(B,z),r=(r=Math.imul(B,H))+Math.imul(R,z)|0,s=Math.imul(R,H),n=n+Math.imul(I,W)|0,r=(r=r+Math.imul(I,K)|0)+Math.imul(T,W)|0,s=s+Math.imul(T,K)|0,n=n+Math.imul(M,$)|0,r=(r=r+Math.imul(M,G)|0)+Math.imul(A,$)|0,s=s+Math.imul(A,G)|0,n=n+Math.imul(k,Y)|0,r=(r=r+Math.imul(k,Z)|0)+Math.imul(E,Y)|0,s=s+Math.imul(E,Z)|0,n=n+Math.imul(_,Q)|0,r=(r=r+Math.imul(_,ee)|0)+Math.imul(x,Q)|0,s=s+Math.imul(x,ee)|0,n=n+Math.imul(v,ie)|0,r=(r=r+Math.imul(v,ne)|0)+Math.imul(g,ie)|0,s=s+Math.imul(g,ne)|0,n=n+Math.imul(h,se)|0,r=(r=r+Math.imul(h,ae)|0)+Math.imul(m,se)|0,s=s+Math.imul(m,ae)|0;var ke=(l+(n=n+Math.imul(p,ce)|0)|0)+((8191&(r=(r=r+Math.imul(p,le)|0)+Math.imul(d,ce)|0))<<13)|0;l=((s=s+Math.imul(d,le)|0)+(r>>>13)|0)+(ke>>>26)|0,ke&=67108863,n=Math.imul(O,z),r=(r=Math.imul(O,H))+Math.imul(P,z)|0,s=Math.imul(P,H),n=n+Math.imul(B,W)|0,r=(r=r+Math.imul(B,K)|0)+Math.imul(R,W)|0,s=s+Math.imul(R,K)|0,n=n+Math.imul(I,$)|0,r=(r=r+Math.imul(I,G)|0)+Math.imul(T,$)|0,s=s+Math.imul(T,G)|0,n=n+Math.imul(M,Y)|0,r=(r=r+Math.imul(M,Z)|0)+Math.imul(A,Y)|0,s=s+Math.imul(A,Z)|0,n=n+Math.imul(k,Q)|0,r=(r=r+Math.imul(k,ee)|0)+Math.imul(E,Q)|0,s=s+Math.imul(E,ee)|0,n=n+Math.imul(_,ie)|0,r=(r=r+Math.imul(_,ne)|0)+Math.imul(x,ie)|0,s=s+Math.imul(x,ne)|0,n=n+Math.imul(v,se)|0,r=(r=r+Math.imul(v,ae)|0)+Math.imul(g,se)|0,s=s+Math.imul(g,ae)|0,n=n+Math.imul(h,ce)|0,r=(r=r+Math.imul(h,le)|0)+Math.imul(m,ce)|0,s=s+Math.imul(m,le)|0;var Ee=(l+(n=n+Math.imul(p,pe)|0)|0)+((8191&(r=(r=r+Math.imul(p,de)|0)+Math.imul(d,pe)|0))<<13)|0;l=((s=s+Math.imul(d,de)|0)+(r>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,n=Math.imul(q,z),r=(r=Math.imul(q,H))+Math.imul(N,z)|0,s=Math.imul(N,H),n=n+Math.imul(O,W)|0,r=(r=r+Math.imul(O,K)|0)+Math.imul(P,W)|0,s=s+Math.imul(P,K)|0,n=n+Math.imul(B,$)|0,r=(r=r+Math.imul(B,G)|0)+Math.imul(R,$)|0,s=s+Math.imul(R,G)|0,n=n+Math.imul(I,Y)|0,r=(r=r+Math.imul(I,Z)|0)+Math.imul(T,Y)|0,s=s+Math.imul(T,Z)|0,n=n+Math.imul(M,Q)|0,r=(r=r+Math.imul(M,ee)|0)+Math.imul(A,Q)|0,s=s+Math.imul(A,ee)|0,n=n+Math.imul(k,ie)|0,r=(r=r+Math.imul(k,ne)|0)+Math.imul(E,ie)|0,s=s+Math.imul(E,ne)|0,n=n+Math.imul(_,se)|0,r=(r=r+Math.imul(_,ae)|0)+Math.imul(x,se)|0,s=s+Math.imul(x,ae)|0,n=n+Math.imul(v,ce)|0,r=(r=r+Math.imul(v,le)|0)+Math.imul(g,ce)|0,s=s+Math.imul(g,le)|0,n=n+Math.imul(h,pe)|0,r=(r=r+Math.imul(h,de)|0)+Math.imul(m,pe)|0,s=s+Math.imul(m,de)|0;var Se=(l+(n=n+Math.imul(p,he)|0)|0)+((8191&(r=(r=r+Math.imul(p,me)|0)+Math.imul(d,he)|0))<<13)|0;l=((s=s+Math.imul(d,me)|0)+(r>>>13)|0)+(Se>>>26)|0,Se&=67108863,n=Math.imul(q,W),r=(r=Math.imul(q,K))+Math.imul(N,W)|0,s=Math.imul(N,K),n=n+Math.imul(O,$)|0,r=(r=r+Math.imul(O,G)|0)+Math.imul(P,$)|0,s=s+Math.imul(P,G)|0,n=n+Math.imul(B,Y)|0,r=(r=r+Math.imul(B,Z)|0)+Math.imul(R,Y)|0,s=s+Math.imul(R,Z)|0,n=n+Math.imul(I,Q)|0,r=(r=r+Math.imul(I,ee)|0)+Math.imul(T,Q)|0,s=s+Math.imul(T,ee)|0,n=n+Math.imul(M,ie)|0,r=(r=r+Math.imul(M,ne)|0)+Math.imul(A,ie)|0,s=s+Math.imul(A,ne)|0,n=n+Math.imul(k,se)|0,r=(r=r+Math.imul(k,ae)|0)+Math.imul(E,se)|0,s=s+Math.imul(E,ae)|0,n=n+Math.imul(_,ce)|0,r=(r=r+Math.imul(_,le)|0)+Math.imul(x,ce)|0,s=s+Math.imul(x,le)|0,n=n+Math.imul(v,pe)|0,r=(r=r+Math.imul(v,de)|0)+Math.imul(g,pe)|0,s=s+Math.imul(g,de)|0;var Me=(l+(n=n+Math.imul(h,he)|0)|0)+((8191&(r=(r=r+Math.imul(h,me)|0)+Math.imul(m,he)|0))<<13)|0;l=((s=s+Math.imul(m,me)|0)+(r>>>13)|0)+(Me>>>26)|0,Me&=67108863,n=Math.imul(q,$),r=(r=Math.imul(q,G))+Math.imul(N,$)|0,s=Math.imul(N,G),n=n+Math.imul(O,Y)|0,r=(r=r+Math.imul(O,Z)|0)+Math.imul(P,Y)|0,s=s+Math.imul(P,Z)|0,n=n+Math.imul(B,Q)|0,r=(r=r+Math.imul(B,ee)|0)+Math.imul(R,Q)|0,s=s+Math.imul(R,ee)|0,n=n+Math.imul(I,ie)|0,r=(r=r+Math.imul(I,ne)|0)+Math.imul(T,ie)|0,s=s+Math.imul(T,ne)|0,n=n+Math.imul(M,se)|0,r=(r=r+Math.imul(M,ae)|0)+Math.imul(A,se)|0,s=s+Math.imul(A,ae)|0,n=n+Math.imul(k,ce)|0,r=(r=r+Math.imul(k,le)|0)+Math.imul(E,ce)|0,s=s+Math.imul(E,le)|0,n=n+Math.imul(_,pe)|0,r=(r=r+Math.imul(_,de)|0)+Math.imul(x,pe)|0,s=s+Math.imul(x,de)|0;var Ae=(l+(n=n+Math.imul(v,he)|0)|0)+((8191&(r=(r=r+Math.imul(v,me)|0)+Math.imul(g,he)|0))<<13)|0;l=((s=s+Math.imul(g,me)|0)+(r>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,n=Math.imul(q,Y),r=(r=Math.imul(q,Z))+Math.imul(N,Y)|0,s=Math.imul(N,Z),n=n+Math.imul(O,Q)|0,r=(r=r+Math.imul(O,ee)|0)+Math.imul(P,Q)|0,s=s+Math.imul(P,ee)|0,n=n+Math.imul(B,ie)|0,r=(r=r+Math.imul(B,ne)|0)+Math.imul(R,ie)|0,s=s+Math.imul(R,ne)|0,n=n+Math.imul(I,se)|0,r=(r=r+Math.imul(I,ae)|0)+Math.imul(T,se)|0,s=s+Math.imul(T,ae)|0,n=n+Math.imul(M,ce)|0,r=(r=r+Math.imul(M,le)|0)+Math.imul(A,ce)|0,s=s+Math.imul(A,le)|0,n=n+Math.imul(k,pe)|0,r=(r=r+Math.imul(k,de)|0)+Math.imul(E,pe)|0,s=s+Math.imul(E,de)|0;var je=(l+(n=n+Math.imul(_,he)|0)|0)+((8191&(r=(r=r+Math.imul(_,me)|0)+Math.imul(x,he)|0))<<13)|0;l=((s=s+Math.imul(x,me)|0)+(r>>>13)|0)+(je>>>26)|0,je&=67108863,n=Math.imul(q,Q),r=(r=Math.imul(q,ee))+Math.imul(N,Q)|0,s=Math.imul(N,ee),n=n+Math.imul(O,ie)|0,r=(r=r+Math.imul(O,ne)|0)+Math.imul(P,ie)|0,s=s+Math.imul(P,ne)|0,n=n+Math.imul(B,se)|0,r=(r=r+Math.imul(B,ae)|0)+Math.imul(R,se)|0,s=s+Math.imul(R,ae)|0,n=n+Math.imul(I,ce)|0,r=(r=r+Math.imul(I,le)|0)+Math.imul(T,ce)|0,s=s+Math.imul(T,le)|0,n=n+Math.imul(M,pe)|0,r=(r=r+Math.imul(M,de)|0)+Math.imul(A,pe)|0,s=s+Math.imul(A,de)|0;var Ie=(l+(n=n+Math.imul(k,he)|0)|0)+((8191&(r=(r=r+Math.imul(k,me)|0)+Math.imul(E,he)|0))<<13)|0;l=((s=s+Math.imul(E,me)|0)+(r>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,n=Math.imul(q,ie),r=(r=Math.imul(q,ne))+Math.imul(N,ie)|0,s=Math.imul(N,ne),n=n+Math.imul(O,se)|0,r=(r=r+Math.imul(O,ae)|0)+Math.imul(P,se)|0,s=s+Math.imul(P,ae)|0,n=n+Math.imul(B,ce)|0,r=(r=r+Math.imul(B,le)|0)+Math.imul(R,ce)|0,s=s+Math.imul(R,le)|0,n=n+Math.imul(I,pe)|0,r=(r=r+Math.imul(I,de)|0)+Math.imul(T,pe)|0,s=s+Math.imul(T,de)|0;var Te=(l+(n=n+Math.imul(M,he)|0)|0)+((8191&(r=(r=r+Math.imul(M,me)|0)+Math.imul(A,he)|0))<<13)|0;l=((s=s+Math.imul(A,me)|0)+(r>>>13)|0)+(Te>>>26)|0,Te&=67108863,n=Math.imul(q,se),r=(r=Math.imul(q,ae))+Math.imul(N,se)|0,s=Math.imul(N,ae),n=n+Math.imul(O,ce)|0,r=(r=r+Math.imul(O,le)|0)+Math.imul(P,ce)|0,s=s+Math.imul(P,le)|0,n=n+Math.imul(B,pe)|0,r=(r=r+Math.imul(B,de)|0)+Math.imul(R,pe)|0,s=s+Math.imul(R,de)|0;var Ce=(l+(n=n+Math.imul(I,he)|0)|0)+((8191&(r=(r=r+Math.imul(I,me)|0)+Math.imul(T,he)|0))<<13)|0;l=((s=s+Math.imul(T,me)|0)+(r>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,n=Math.imul(q,ce),r=(r=Math.imul(q,le))+Math.imul(N,ce)|0,s=Math.imul(N,le),n=n+Math.imul(O,pe)|0,r=(r=r+Math.imul(O,de)|0)+Math.imul(P,pe)|0,s=s+Math.imul(P,de)|0;var Be=(l+(n=n+Math.imul(B,he)|0)|0)+((8191&(r=(r=r+Math.imul(B,me)|0)+Math.imul(R,he)|0))<<13)|0;l=((s=s+Math.imul(R,me)|0)+(r>>>13)|0)+(Be>>>26)|0,Be&=67108863,n=Math.imul(q,pe),r=(r=Math.imul(q,de))+Math.imul(N,pe)|0,s=Math.imul(N,de);var Re=(l+(n=n+Math.imul(O,he)|0)|0)+((8191&(r=(r=r+Math.imul(O,me)|0)+Math.imul(P,he)|0))<<13)|0;l=((s=s+Math.imul(P,me)|0)+(r>>>13)|0)+(Re>>>26)|0,Re&=67108863;var Le=(l+(n=Math.imul(q,he))|0)+((8191&(r=(r=Math.imul(q,me))+Math.imul(N,he)|0))<<13)|0;return l=((s=Math.imul(N,me))+(r>>>13)|0)+(Le>>>26)|0,Le&=67108863,c[0]=be,c[1]=ve,c[2]=ge,c[3]=ye,c[4]=_e,c[5]=xe,c[6]=we,c[7]=ke,c[8]=Ee,c[9]=Se,c[10]=Me,c[11]=Ae,c[12]=je,c[13]=Ie,c[14]=Te,c[15]=Ce,c[16]=Be,c[17]=Re,c[18]=Le,0!==l&&(c[19]=l,i.length++),i};function m(e,t,i){return(new b).mulp(e,t,i)}function b(e,t){this.x=e,this.y=t}Math.imul||(h=f),s.prototype.mulTo=function(e,t){var i,n=this.length+e.length;return i=10===this.length&&10===e.length?h(this,e,t):n<63?f(this,e,t):n<1024?function(e,t,i){i.negative=t.negative^e.negative,i.length=e.length+t.length;for(var n=0,r=0,s=0;s>>26)|0)>>>26,a&=67108863}i.words[s]=o,n=a,a=r}return 0!==n?i.words[s]=n:i.length--,i.strip()}(this,e,t):m(this,e,t),i},b.prototype.makeRBT=function(e){for(var t=new Array(e),i=s.prototype._countBits(e)-1,n=0;n>=1;return n},b.prototype.permute=function(e,t,i,n,r,s){for(var a=0;a>>=1)r++;return 1<>>=13,i[2*a+1]=8191&s,s>>>=13;for(a=2*t;a>=26,t+=r/67108864|0,t+=s>>>26,this.words[i]=67108863&s}return 0!==t&&(this.words[i]=t,this.length++),this},s.prototype.muln=function(e){return this.clone().imuln(e)},s.prototype.sqr=function(){return this.mul(this)},s.prototype.isqr=function(){return this.imul(this.clone())},s.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),i=0;i>>r}return t}(e);if(0===t.length)return new s(1);for(var i=this,n=0;n=0);var t,i=e%26,r=(e-i)/26,s=67108863>>>26-i<<26-i;if(0!==i){var a=0;for(t=0;t>>26-i}a&&(this.words[t]=a,this.length++)}if(0!==r){for(t=this.length-1;t>=0;t--)this.words[t+r]=this.words[t];for(t=0;t=0),r=t?(t-t%26)/26:0;var s=e%26,a=Math.min((e-s)/26,this.length),o=67108863^67108863>>>s<a)for(this.length-=a,l=0;l=0&&(0!==u||l>=r);l--){var p=0|this.words[l];this.words[l]=u<<26-s|p>>>s,u=p&o}return c&&0!==u&&(c.words[c.length++]=u),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},s.prototype.ishrn=function(e,t,i){return n(0===this.negative),this.iushrn(e,t,i)},s.prototype.shln=function(e){return this.clone().ishln(e)},s.prototype.ushln=function(e){return this.clone().iushln(e)},s.prototype.shrn=function(e){return this.clone().ishrn(e)},s.prototype.ushrn=function(e){return this.clone().iushrn(e)},s.prototype.testn=function(e){n("number"==typeof e&&e>=0);var t=e%26,i=(e-t)/26,r=1<=0);var t=e%26,i=(e-t)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=i)return this;if(0!==t&&i++,this.length=Math.min(i,this.length),0!==t){var r=67108863^67108863>>>t<=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},s.prototype.isubn=function(e){if(n("number"==typeof e),n(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t>26)-(c/67108864|0),this.words[r+i]=67108863&s}for(;r>26,this.words[r+i]=67108863&s;if(0===o)return this.strip();for(n(-1===o),o=0,r=0;r>26,this.words[r]=67108863&s;return this.negative=1,this.strip()},s.prototype._wordDiv=function(e,t){var i=(this.length,e.length),n=this.clone(),r=e,a=0|r.words[r.length-1];0!==(i=26-this._countBits(a))&&(r=r.ushln(i),n.iushln(i),a=0|r.words[r.length-1]);var o,c=n.length-r.length;if("mod"!==t){(o=new s(null)).length=c+1,o.words=new Array(o.length);for(var l=0;l=0;p--){var d=67108864*(0|n.words[r.length+p])+(0|n.words[r.length+p-1]);for(d=Math.min(d/a|0,67108863),n._ishlnsubmul(r,d,p);0!==n.negative;)d--,n.negative=0,n._ishlnsubmul(r,1,p),n.isZero()||(n.negative^=1);o&&(o.words[p]=d)}return o&&o.strip(),n.strip(),"div"!==t&&0!==i&&n.iushrn(i),{div:o||null,mod:n}},s.prototype.divmod=function(e,t,i){return n(!e.isZero()),this.isZero()?{div:new s(0),mod:new s(0)}:0!==this.negative&&0===e.negative?(o=this.neg().divmod(e,t),"mod"!==t&&(r=o.div.neg()),"div"!==t&&(a=o.mod.neg(),i&&0!==a.negative&&a.iadd(e)),{div:r,mod:a}):0===this.negative&&0!==e.negative?(o=this.divmod(e.neg(),t),"mod"!==t&&(r=o.div.neg()),{div:r,mod:o.mod}):0!=(this.negative&e.negative)?(o=this.neg().divmod(e.neg(),t),"div"!==t&&(a=o.mod.neg(),i&&0!==a.negative&&a.isub(e)),{div:o.div,mod:a}):e.length>this.length||this.cmp(e)<0?{div:new s(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new s(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new s(this.modn(e.words[0]))}:this._wordDiv(e,t);var r,a,o},s.prototype.div=function(e){return this.divmod(e,"div",!1).div},s.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},s.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},s.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var i=0!==t.div.negative?t.mod.isub(e):t.mod,n=e.ushrn(1),r=e.andln(1),s=i.cmp(n);return s<0||1===r&&0===s?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},s.prototype.modn=function(e){n(e<=67108863);for(var t=(1<<26)%e,i=0,r=this.length-1;r>=0;r--)i=(t*i+(0|this.words[r]))%e;return i},s.prototype.idivn=function(e){n(e<=67108863);for(var t=0,i=this.length-1;i>=0;i--){var r=(0|this.words[i])+67108864*t;this.words[i]=r/e|0,t=r%e}return this.strip()},s.prototype.divn=function(e){return this.clone().idivn(e)},s.prototype.egcd=function(e){n(0===e.negative),n(!e.isZero());var t=this,i=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var r=new s(1),a=new s(0),o=new s(0),c=new s(1),l=0;t.isEven()&&i.isEven();)t.iushrn(1),i.iushrn(1),++l;for(var u=i.clone(),p=t.clone();!t.isZero();){for(var d=0,f=1;0==(t.words[0]&f)&&d<26;++d,f<<=1);if(d>0)for(t.iushrn(d);d-- >0;)(r.isOdd()||a.isOdd())&&(r.iadd(u),a.isub(p)),r.iushrn(1),a.iushrn(1);for(var h=0,m=1;0==(i.words[0]&m)&&h<26;++h,m<<=1);if(h>0)for(i.iushrn(h);h-- >0;)(o.isOdd()||c.isOdd())&&(o.iadd(u),c.isub(p)),o.iushrn(1),c.iushrn(1);t.cmp(i)>=0?(t.isub(i),r.isub(o),a.isub(c)):(i.isub(t),o.isub(r),c.isub(a))}return{a:o,b:c,gcd:i.iushln(l)}},s.prototype._invmp=function(e){n(0===e.negative),n(!e.isZero());var t=this,i=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var r,a=new s(1),o=new s(0),c=i.clone();t.cmpn(1)>0&&i.cmpn(1)>0;){for(var l=0,u=1;0==(t.words[0]&u)&&l<26;++l,u<<=1);if(l>0)for(t.iushrn(l);l-- >0;)a.isOdd()&&a.iadd(c),a.iushrn(1);for(var p=0,d=1;0==(i.words[0]&d)&&p<26;++p,d<<=1);if(p>0)for(i.iushrn(p);p-- >0;)o.isOdd()&&o.iadd(c),o.iushrn(1);t.cmp(i)>=0?(t.isub(i),a.isub(o)):(i.isub(t),o.isub(a))}return(r=0===t.cmpn(1)?a:o).cmpn(0)<0&&r.iadd(e),r},s.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),i=e.clone();t.negative=0,i.negative=0;for(var n=0;t.isEven()&&i.isEven();n++)t.iushrn(1),i.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;i.isEven();)i.iushrn(1);var r=t.cmp(i);if(r<0){var s=t;t=i,i=s}else if(0===r||0===i.cmpn(1))break;t.isub(i)}return i.iushln(n)},s.prototype.invm=function(e){return this.egcd(e).a.umod(e)},s.prototype.isEven=function(){return 0==(1&this.words[0])},s.prototype.isOdd=function(){return 1==(1&this.words[0])},s.prototype.andln=function(e){return this.words[0]&e},s.prototype.bincn=function(e){n("number"==typeof e);var t=e%26,i=(e-t)/26,r=1<>>26,o&=67108863,this.words[a]=o}return 0!==s&&(this.words[a]=s,this.length++),this},s.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},s.prototype.cmpn=function(e){var t,i=e<0;if(0!==this.negative&&!i)return-1;if(0===this.negative&&i)return 1;if(this.strip(),this.length>1)t=1;else{i&&(e=-e),n(e<=67108863,"Number is too big");var r=0|this.words[0];t=r===e?0:re.length)return 1;if(this.length=0;i--){var n=0|this.words[i],r=0|e.words[i];if(n!==r){nr&&(t=1);break}}return t},s.prototype.gtn=function(e){return 1===this.cmpn(e)},s.prototype.gt=function(e){return 1===this.cmp(e)},s.prototype.gten=function(e){return this.cmpn(e)>=0},s.prototype.gte=function(e){return this.cmp(e)>=0},s.prototype.ltn=function(e){return-1===this.cmpn(e)},s.prototype.lt=function(e){return-1===this.cmp(e)},s.prototype.lten=function(e){return this.cmpn(e)<=0},s.prototype.lte=function(e){return this.cmp(e)<=0},s.prototype.eqn=function(e){return 0===this.cmpn(e)},s.prototype.eq=function(e){return 0===this.cmp(e)},s.red=function(e){return new k(e)},s.prototype.toRed=function(e){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},s.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},s.prototype._forceRed=function(e){return this.red=e,this},s.prototype.forceRed=function(e){return n(!this.red,"Already a number in reduction context"),this._forceRed(e)},s.prototype.redAdd=function(e){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},s.prototype.redIAdd=function(e){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},s.prototype.redSub=function(e){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},s.prototype.redISub=function(e){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},s.prototype.redShl=function(e){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},s.prototype.redMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},s.prototype.redIMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},s.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},s.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},s.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},s.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},s.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},s.prototype.redPow=function(e){return n(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var v={k256:null,p224:null,p192:null,p25519:null};function g(e,t){this.name=e,this.p=new s(t,16),this.n=this.p.bitLength(),this.k=new s(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function y(){g.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function _(){g.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function x(){g.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function w(){g.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function k(e){if("string"==typeof e){var t=s._prime(e);this.m=t.p,this.prime=t}else n(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function E(e){k.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new s(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}g.prototype._tmp=function(){var e=new s(null);return e.words=new Array(Math.ceil(this.n/13)),e},g.prototype.ireduce=function(e){var t,i=e;do{this.split(i,this.tmp),t=(i=(i=this.imulK(i)).iadd(this.tmp)).bitLength()}while(t>this.n);var n=t0?i.isub(this.p):void 0!==i.strip?i.strip():i._strip(),i},g.prototype.split=function(e,t){e.iushrn(this.n,0,t)},g.prototype.imulK=function(e){return e.imul(this.k)},r(y,g),y.prototype.split=function(e,t){for(var i=4194303,n=Math.min(e.length,9),r=0;r>>22,s=a}s>>>=22,e.words[r-10]=s,0===s&&e.length>10?e.length-=10:e.length-=9},y.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,i=0;i>>=26,e.words[i]=r,t=n}return 0!==t&&(e.words[e.length++]=t),e},s._prime=function(e){if(v[e])return v[e];var t;if("k256"===e)t=new y;else if("p224"===e)t=new _;else if("p192"===e)t=new x;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new w}return v[e]=t,t},k.prototype._verify1=function(e){n(0===e.negative,"red works only with positives"),n(e.red,"red works only with red numbers")},k.prototype._verify2=function(e,t){n(0==(e.negative|t.negative),"red works only with positives"),n(e.red&&e.red===t.red,"red works only with red numbers")},k.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},k.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},k.prototype.add=function(e,t){this._verify2(e,t);var i=e.add(t);return i.cmp(this.m)>=0&&i.isub(this.m),i._forceRed(this)},k.prototype.iadd=function(e,t){this._verify2(e,t);var i=e.iadd(t);return i.cmp(this.m)>=0&&i.isub(this.m),i},k.prototype.sub=function(e,t){this._verify2(e,t);var i=e.sub(t);return i.cmpn(0)<0&&i.iadd(this.m),i._forceRed(this)},k.prototype.isub=function(e,t){this._verify2(e,t);var i=e.isub(t);return i.cmpn(0)<0&&i.iadd(this.m),i},k.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},k.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},k.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},k.prototype.isqr=function(e){return this.imul(e,e.clone())},k.prototype.sqr=function(e){return this.mul(e,e)},k.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(n(t%2==1),3===t){var i=this.m.add(new s(1)).iushrn(2);return this.pow(e,i)}for(var r=this.m.subn(1),a=0;!r.isZero()&&0===r.andln(1);)a++,r.iushrn(1);n(!r.isZero());var o=new s(1).toRed(this),c=o.redNeg(),l=this.m.subn(1).iushrn(1),u=this.m.bitLength();for(u=new s(2*u*u).toRed(this);0!==this.pow(u,l).cmp(c);)u.redIAdd(c);for(var p=this.pow(u,r),d=this.pow(e,r.addn(1).iushrn(1)),f=this.pow(e,r),h=a;0!==f.cmp(o);){for(var m=f,b=0;0!==m.cmp(o);b++)m=m.redSqr();n(b=0;n--){for(var l=t.words[n],u=c-1;u>=0;u--){var p=l>>u&1;r!==i[0]&&(r=this.sqr(r)),0!==p||0!==a?(a<<=1,a|=p,(4===++o||0===n&&0===u)&&(r=this.mul(r,i[a]),o=0,a=0)):o=0}c=26}return r},k.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},k.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},s.mont=function(e){return new E(e)},r(E,k),E.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},E.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},E.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var i=e.imul(t),n=i.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),r=i.isub(n).iushrn(this.shift),s=r;return r.cmp(this.m)>=0?s=r.isub(this.m):r.cmpn(0)<0&&(s=r.iadd(this.m)),s._forceRed(this)},E.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new s(0)._forceRed(this);var i=e.mul(t),n=i.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),r=i.isub(n).iushrn(this.shift),a=r;return r.cmp(this.m)>=0?a=r.isub(this.m):r.cmpn(0)<0&&(a=r.iadd(this.m)),a._forceRed(this)},E.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(void 0===t||t,this)},{buffer:67}],19:[function(e,t,i){"use strict";i.byteLength=function(e){var t=l(e),i=t[0],n=t[1];return 3*(i+n)/4-n},i.toByteArray=function(e){var t,i,n=l(e),a=n[0],o=n[1],c=new s(function(e,t,i){return 3*(t+i)/4-i}(0,a,o)),u=0,p=o>0?a-4:a;for(i=0;i>16&255,c[u++]=t>>8&255,c[u++]=255&t;2===o&&(t=r[e.charCodeAt(i)]<<2|r[e.charCodeAt(i+1)]>>4,c[u++]=255&t);1===o&&(t=r[e.charCodeAt(i)]<<10|r[e.charCodeAt(i+1)]<<4|r[e.charCodeAt(i+2)]>>2,c[u++]=t>>8&255,c[u++]=255&t);return c},i.fromByteArray=function(e){for(var t,i=e.length,r=i%3,s=[],a=16383,o=0,c=i-r;oc?c:o+a));1===r?(t=e[i-1],s.push(n[t>>2]+n[t<<4&63]+"==")):2===r&&(t=(e[i-2]<<8)+e[i-1],s.push(n[t>>10]+n[t>>4&63]+n[t<<2&63]+"="));return s.join("")};for(var n=[],r=[],s="undefined"!=typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",o=0,c=a.length;o0)throw new Error("Invalid string. Length must be a multiple of 4");var i=e.indexOf("=");return-1===i&&(i=t),[i,i===t?0:4-i%4]}function u(e,t,i){for(var r,s,a=[],o=t;o>18&63]+n[s>>12&63]+n[s>>6&63]+n[63&s]);return a.join("")}r["-".charCodeAt(0)]=62,r["_".charCodeAt(0)]=63},{}],20:[function(e,t,i){(function(e){(function(){function i(e,t,i){let n=0,r=1;for(let s=t;s=48)n=10*n+(i-48);else if(s!==t||43!==i){if(s!==t||45!==i){if(46===i)break;throw new Error("not a number: buffer["+s+"] = "+i)}r=-1}}return n*r}function n(t,i,r,s){return null==t||0===t.length?null:("number"!=typeof i&&null==s&&(s=i,i=void 0),"number"!=typeof r&&null==s&&(s=r,r=void 0),n.position=0,n.encoding=s||null,n.data=e.isBuffer(t)?t.slice(i,r):e.from(t),n.bytes=n.data.length,n.next())}n.bytes=0,n.position=0,n.data=null,n.encoding=null,n.next=function(){switch(n.data[n.position]){case 100:return n.dictionary();case 108:return n.list();case 105:return n.integer();default:return n.buffer()}},n.find=function(e){let t=n.position;const i=n.data.length,r=n.data;for(;t{const r=t.split("-").map((e=>parseInt(e)));return e.concat(((e,t=e)=>Array.from({length:t-e+1},((t,i)=>i+e)))(...r))}),[])}t.exports=n,t.exports.parse=n,t.exports.compose=function(e){return e.reduce(((e,t,i,n)=>(0!==i&&t===n[i-1]+1||e.push([]),e[e.length-1].push(t),e)),[]).map((e=>e.length>1?`${e[0]}-${e[e.length-1]}`:`${e[0]}`))}},{}],26:[function(e,t,i){t.exports=function(e,t,i,n,r){var s,a;if(void 0===n)n=0;else if((n|=0)<0||n>=e.length)throw new RangeError("invalid lower bound");if(void 0===r)r=e.length-1;else if((r|=0)=e.length)throw new RangeError("invalid upper bound");for(;n<=r;)if((a=+i(e[s=n+(r-n>>>1)],t,s,e))<0)n=s+1;else{if(!(a>0))return s;r=s-1}return~n}},{}],27:[function(e,t,i){"use strict";function n(e){var t=e>>3;return e%8!=0&&t++,t}Object.defineProperty(i,"__esModule",{value:!0});var r=function(){function e(e,t){void 0===e&&(e=0);var i=null==t?void 0:t.grow;this.grow=i&&isFinite(i)&&n(i)||i||0,this.buffer="number"==typeof e?new Uint8Array(n(e)):e}return e.prototype.get=function(e){var t=e>>3;return t>e%8)},e.prototype.set=function(e,t){void 0===t&&(t=!0);var i=e>>3;if(t){if(this.buffer.length>e%8}else i>e%8))},e.prototype.forEach=function(e,t,i){void 0===t&&(t=0),void 0===i&&(i=8*this.buffer.length);for(var n=t,r=n>>3,s=128>>n%8,a=this.buffer[r];n>1},e}();i.default=r},{}],28:[function(e,t,i){(function(i){(function(){ /*! bittorrent-protocol. MIT License. WebTorrent LLC */ -const i=e("unordered-array-remove"),r=e("bencode"),s=e("bitfield").default,o=e("crypto"),a=e("debug")("bittorrent-protocol"),c=e("randombytes"),u=e("simple-sha1"),l=e("speedometer"),d=e("readable-stream"),f=e("rc4"),p=n.from("BitTorrent protocol"),h=n.from([0,0,0,0]),m=n.from([0,0,0,1,0]),b=n.from([0,0,0,1,1]),g=n.from([0,0,0,1,2]),v=n.from([0,0,0,1,3]),y=[0,0,0,0,0,0,0,0],_=[0,0,0,3,9,0,0],w=n.from([0,0,0,0,0,0,0,0]),x=n.from([0,0,1,2]),k=n.from([0,0,0,2]);function E(e,t){for(let n=e.length;n--;)e[n]^=t[n];return e}class S{constructor(e,t,n,i){this.piece=e,this.offset=t,this.length=n,this.callback=i}}class M extends d.Duplex{constructor(e=null,t=0,n=!1){super(),this._debugId=c(4).toString("hex"),this._debug("new wire"),this.peerId=null,this.peerIdBuffer=null,this.type=e,this.amChoking=!0,this.amInterested=!1,this.peerChoking=!0,this.peerInterested=!1,this.peerPieces=new s(0,{grow:4e5}),this.peerExtensions={},this.requests=[],this.peerRequests=[],this.extendedMapping={},this.peerExtendedMapping={},this.extendedHandshake={},this.peerExtendedHandshake={},this._ext={},this._nextExt=1,this.uploaded=0,this.downloaded=0,this.uploadSpeed=l(),this.downloadSpeed=l(),this._keepAliveInterval=null,this._timeout=null,this._timeoutMs=0,this._timeoutExpiresAt=null,this.destroyed=!1,this._finished=!1,this._parserSize=0,this._parser=null,this._buffer=[],this._bufferSize=0,this._peEnabled=n,n?(this._dh=o.createDiffieHellman("ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a63a36210000000000090563","hex",2),this._myPubKey=this._dh.generateKeys("hex")):this._myPubKey=null,this._peerPubKey=null,this._sharedSecret=null,this._peerCryptoProvide=[],this._cryptoHandshakeDone=!1,this._cryptoSyncPattern=null,this._waitMaxBytes=null,this._encryptionMethod=null,this._encryptGenerator=null,this._decryptGenerator=null,this._setGenerators=!1,this.once("finish",(()=>this._onFinish())),this.on("finish",this._onFinish),this._debug("type:",this.type),"tcpIncoming"===this.type&&this._peEnabled?this._determineHandshakeType():"tcpOutgoing"===this.type&&this._peEnabled&&0===t?this._parsePe2():this._parseHandshake(null)}setKeepAlive(e){this._debug("setKeepAlive %s",e),clearInterval(this._keepAliveInterval),!1!==e&&(this._keepAliveInterval=setInterval((()=>{this.keepAlive()}),55e3))}setTimeout(e,t){this._debug("setTimeout ms=%d unref=%s",e,t),this._timeoutMs=e,this._timeoutUnref=!!t,this._resetTimeout(!0)}destroy(){this.destroyed||(this.destroyed=!0,this._debug("destroy"),this.emit("close"),this.end())}end(...e){this._debug("end"),this._onUninterested(),this._onChoke(),super.end(...e)}use(e){const t=e.prototype.name;if(!t)throw new Error('Extension class requires a "name" property on the prototype');this._debug("use extension.name=%s",t);const n=this._nextExt,i=new e(this);function r(){}"function"!=typeof i.onHandshake&&(i.onHandshake=r),"function"!=typeof i.onExtendedHandshake&&(i.onExtendedHandshake=r),"function"!=typeof i.onMessage&&(i.onMessage=r),this.extendedMapping[n]=t,this._ext[t]=i,this[t]=i,this._nextExt+=1}keepAlive(){this._debug("keep-alive"),this._push(h)}sendPe1(){if(this._peEnabled){const e=Math.floor(513*Math.random()),t=c(e);this._push(n.concat([n.from(this._myPubKey,"hex"),t]))}}sendPe2(){const e=Math.floor(513*Math.random()),t=c(e);this._push(n.concat([n.from(this._myPubKey,"hex"),t]))}sendPe3(e){this.setEncrypt(this._sharedSecret,e);const t=n.from(u.sync(n.from(this._utfToHex("req1")+this._sharedSecret,"hex")),"hex"),i=E(n.from(u.sync(n.from(this._utfToHex("req2")+e,"hex")),"hex"),n.from(u.sync(n.from(this._utfToHex("req3")+this._sharedSecret,"hex")),"hex")),r=c(2).readUInt16BE(0)%512,s=c(r);let o=n.alloc(14+r+2);w.copy(o),x.copy(o,8),o.writeInt16BE(r,12),s.copy(o,14),o.writeInt16BE(0,14+r),o=this._encryptHandshake(o),this._push(n.concat([t,i,o]))}sendPe4(e){this.setEncrypt(this._sharedSecret,e);const t=c(2).readUInt16BE(0)%512,i=c(t);let r=n.alloc(14+t);w.copy(r),k.copy(r,8),r.writeInt16BE(t,12),i.copy(r,14),r=this._encryptHandshake(r),this._push(r),this._cryptoHandshakeDone=!0,this._debug("completed crypto handshake")}handshake(e,t,i){let r,s;if("string"==typeof e?(e=e.toLowerCase(),r=n.from(e,"hex")):(r=e,e=r.toString("hex")),"string"==typeof t?s=n.from(t,"hex"):(s=t,t=s.toString("hex")),this._infoHash=r,20!==r.length||20!==s.length)throw new Error("infoHash and peerId MUST have length 20");this._debug("handshake i=%s p=%s exts=%o",e,t,i);const o=n.from(y);o[5]|=16,i&&i.dht&&(o[7]|=1),this._push(n.concat([p,o,r,s])),this._handshakeSent=!0,this.peerExtensions.extended&&!this._extendedHandshakeSent&&this._sendExtendedHandshake()}_sendExtendedHandshake(){const e=Object.assign({},this.extendedHandshake);e.m={};for(const t in this.extendedMapping){const n=this.extendedMapping[t];e.m[n]=Number(t)}this.extended(0,r.encode(e)),this._extendedHandshakeSent=!0}choke(){if(!this.amChoking){for(this.amChoking=!0,this._debug("choke");this.peerRequests.length;)this.peerRequests.pop();this._push(m)}}unchoke(){this.amChoking&&(this.amChoking=!1,this._debug("unchoke"),this._push(b))}interested(){this.amInterested||(this.amInterested=!0,this._debug("interested"),this._push(g))}uninterested(){this.amInterested&&(this.amInterested=!1,this._debug("uninterested"),this._push(v))}have(e){this._debug("have %d",e),this._message(4,[e],null)}bitfield(e){this._debug("bitfield"),n.isBuffer(e)||(e=e.buffer),this._message(5,[],e)}request(e,t,n,i){return i||(i=()=>{}),this._finished?i(new Error("wire is closed")):this.peerChoking?i(new Error("peer is choking")):(this._debug("request index=%d offset=%d length=%d",e,t,n),this.requests.push(new S(e,t,n,i)),this._timeout||this._resetTimeout(!0),void this._message(6,[e,t,n],null))}piece(e,t,n){this._debug("piece index=%d offset=%d",e,t),this._message(7,[e,t],n),this.uploaded+=n.length,this.uploadSpeed(n.length),this.emit("upload",n.length)}cancel(e,t,n){this._debug("cancel index=%d offset=%d length=%d",e,t,n),this._callback(this._pull(this.requests,e,t,n),new Error("request was cancelled"),null),this._message(8,[e,t,n],null)}port(e){this._debug("port %d",e);const t=n.from(_);t.writeUInt16BE(e,5),this._push(t)}extended(e,t){if(this._debug("extended ext=%s",e),"string"==typeof e&&this.peerExtendedMapping[e]&&(e=this.peerExtendedMapping[e]),"number"!=typeof e)throw new Error(`Unrecognized extension: ${e}`);{const i=n.from([e]),s=n.isBuffer(t)?t:r.encode(t);this._message(20,[],n.concat([i,s]))}}setEncrypt(e,t){let i,r,s,o,a,c;switch(this.type){case"tcpIncoming":i=u.sync(n.from(this._utfToHex("keyB")+e+t,"hex")),r=u.sync(n.from(this._utfToHex("keyA")+e+t,"hex")),s=n.from(i,"hex"),o=[];for(const e of s.values())o.push(e);a=n.from(r,"hex"),c=[];for(const e of a.values())c.push(e);this._encryptGenerator=new f(o),this._decryptGenerator=new f(c);break;case"tcpOutgoing":i=u.sync(n.from(this._utfToHex("keyA")+e+t,"hex")),r=u.sync(n.from(this._utfToHex("keyB")+e+t,"hex")),s=n.from(i,"hex"),o=[];for(const e of s.values())o.push(e);a=n.from(r,"hex"),c=[];for(const e of a.values())c.push(e);this._encryptGenerator=new f(o),this._decryptGenerator=new f(c);break;default:return!1}for(let e=0;e<1024;e++)this._encryptGenerator.randomByte(),this._decryptGenerator.randomByte();return this._setGenerators=!0,!0}_read(){}_message(e,t,i){const r=i?i.length:0,s=n.allocUnsafe(5+4*t.length);s.writeUInt32BE(s.length+r-4,0),s[4]=e;for(let e=0;e{if(r===this._pull(this.peerRequests,e,t,n))return i?this._debug("error satisfying request index=%d offset=%d length=%d (%s)",e,t,n,i.message):void this.piece(e,t,s)},r=new S(e,t,n,i);this.peerRequests.push(r),this.emit("request",e,t,n,i)}_onPiece(e,t,n){this._debug("got piece index=%d offset=%d",e,t),this._callback(this._pull(this.requests,e,t,n.length),null,n),this.downloaded+=n.length,this.downloadSpeed(n.length),this.emit("download",n.length),this.emit("piece",e,t,n)}_onCancel(e,t,n){this._debug("got cancel index=%d offset=%d length=%d",e,t,n),this._pull(this.peerRequests,e,t,n),this.emit("cancel",e,t,n)}_onPort(e){this._debug("got port %d",e),this.emit("port",e)}_onExtended(e,t){if(0===e){let e;try{e=r.decode(t)}catch(e){this._debug("ignoring invalid extended handshake: %s",e.message||e)}if(!e)return;if(this.peerExtendedHandshake=e,"object"==typeof e.m)for(const t in e.m)this.peerExtendedMapping[t]=Number(e.m[t].toString());for(const e in this._ext)this.peerExtendedMapping[e]&&this._ext[e].onExtendedHandshake(this.peerExtendedHandshake);this._debug("got extended handshake"),this.emit("extended","handshake",this.peerExtendedHandshake)}else this.extendedMapping[e]&&(e=this.extendedMapping[e],this._ext[e]&&this._ext[e].onMessage(t)),this._debug("got extended message ext=%s",e),this.emit("extended",e,t)}_onTimeout(){this._debug("request timed out"),this._callback(this.requests.shift(),new Error("request has timed out"),null),this.emit("timeout")}_write(e,t,i){if(2===this._encryptionMethod&&this._cryptoHandshakeDone&&(e=this._decrypt(e)),this._bufferSize+=e.length,this._buffer.push(e),this._buffer.length>1&&(this._buffer=[n.concat(this._buffer,this._bufferSize)]),this._cryptoSyncPattern){const t=this._buffer[0].indexOf(this._cryptoSyncPattern);if(-1!==t)this._buffer[0]=this._buffer[0].slice(t+this._cryptoSyncPattern.length),this._bufferSize-=t+this._cryptoSyncPattern.length,this._cryptoSyncPattern=null;else if(this._bufferSize+e.length>this._waitMaxBytes+this._cryptoSyncPattern.length)return this._debug("Error: could not resynchronize"),void this.destroy()}for(;this._bufferSize>=this._parserSize&&!this._cryptoSyncPattern;)if(0===this._parserSize)this._parser(n.from([]));else{const e=this._buffer[0];this._bufferSize-=this._parserSize,this._buffer=this._bufferSize?[e.slice(this._parserSize)]:[],this._parser(e.slice(0,this._parserSize))}i(null)}_callback(e,t,n){e&&(this._resetTimeout(!this.peerChoking&&!this._finished),e.callback(t,n))}_resetTimeout(e){if(!e||!this._timeoutMs||!this.requests.length)return clearTimeout(this._timeout),this._timeout=null,void(this._timeoutExpiresAt=null);const t=Date.now()+this._timeoutMs;if(this._timeout){if(t-this._timeoutExpiresAt<.05*this._timeoutMs)return;clearTimeout(this._timeout)}this._timeoutExpiresAt=t,this._timeout=setTimeout((()=>this._onTimeout()),this._timeoutMs),this._timeoutUnref&&this._timeout.unref&&this._timeout.unref()}_parse(e,t){this._parserSize=e,this._parser=t}_parseUntil(e,t){this._cryptoSyncPattern=e,this._waitMaxBytes=t}_onMessageLength(e){const t=e.readUInt32BE(0);t>0?this._parse(t,this._onMessage):(this._onKeepAlive(),this._parse(4,this._onMessageLength))}_onMessage(e){switch(this._parse(4,this._onMessageLength),e[0]){case 0:return this._onChoke();case 1:return this._onUnchoke();case 2:return this._onInterested();case 3:return this._onUninterested();case 4:return this._onHave(e.readUInt32BE(1));case 5:return this._onBitField(e.slice(1));case 6:return this._onRequest(e.readUInt32BE(1),e.readUInt32BE(5),e.readUInt32BE(9));case 7:return this._onPiece(e.readUInt32BE(1),e.readUInt32BE(5),e.slice(9));case 8:return this._onCancel(e.readUInt32BE(1),e.readUInt32BE(5),e.readUInt32BE(9));case 9:return this._onPort(e.readUInt16BE(1));case 20:return this._onExtended(e.readUInt8(1),e.slice(2));default:return this._debug("got unknown message"),this.emit("unknownmessage",e)}}_determineHandshakeType(){this._parse(1,(e=>{const t=e.readUInt8(0);19===t?this._parse(t+48,this._onHandshakeBuffer):this._parsePe1(e)}))}_parsePe1(e){this._parse(95,(t=>{this._onPe1(n.concat([e,t])),this._parsePe3()}))}_parsePe2(){this._parse(96,(e=>{for(this._onPe2(e);!this._setGenerators;);this._parsePe4()}))}_parsePe3(){const e=n.from(u.sync(n.from(this._utfToHex("req1")+this._sharedSecret,"hex")),"hex");this._parseUntil(e,512),this._parse(20,(e=>{for(this._onPe3(e);!this._setGenerators;);this._parsePe3Encrypted()}))}_parsePe3Encrypted(){this._parse(14,(e=>{const t=this._decryptHandshake(e.slice(0,8)),n=this._decryptHandshake(e.slice(8,12)),i=this._decryptHandshake(e.slice(12,14)).readUInt16BE(0);this._parse(i,(e=>{e=this._decryptHandshake(e),this._parse(2,(i=>{const r=this._decryptHandshake(i).readUInt16BE(0);this._parse(r,(i=>{i=this._decryptHandshake(i),this._onPe3Encrypted(t,n,e,i);const s=r?i.readUInt8(0):null,o=r?i.slice(1,20):null;19===s&&"BitTorrent protocol"===o.toString()?this._onHandshakeBuffer(i.slice(1)):this._parseHandshake()}))}))}))}))}_parsePe4(){const e=this._decryptHandshake(w);this._parseUntil(e,512),this._parse(6,(e=>{const t=this._decryptHandshake(e.slice(0,4)),n=this._decryptHandshake(e.slice(4,6)).readUInt16BE(0);this._parse(n,(e=>{this._decryptHandshake(e),this._onPe4(t),this._parseHandshake(null)}))}))}_parseHandshake(){this._parse(1,(e=>{const t=e.readUInt8(0);if(19!==t)return this._debug("Error: wire not speaking BitTorrent protocol (%s)",t.toString()),void this.end();this._parse(t+48,this._onHandshakeBuffer)}))}_onHandshakeBuffer(e){const t=e.slice(0,19);if("BitTorrent protocol"!==t.toString())return this._debug("Error: wire not speaking BitTorrent protocol (%s)",t.toString()),void this.end();e=e.slice(19),this._onHandshake(e.slice(8,28),e.slice(28,48),{dht:!!(1&e[7]),extended:!!(16&e[5])}),this._parse(4,this._onMessageLength)}_onFinish(){for(this._finished=!0,this.push(null);this.read(););for(clearInterval(this._keepAliveInterval),this._parse(Number.MAX_VALUE,(()=>{}));this.peerRequests.length;)this.peerRequests.pop();for(;this.requests.length;)this._callback(this.requests.pop(),new Error("wire was closed"),null)}_debug(...e){e[0]=`[${this._debugId}] ${e[0]}`,a(...e)}_pull(e,t,n,r){for(let s=0;s{"%%"!==e&&(i++,"%c"===e&&(r=i))})),e.splice(r,0,n)},n.save=function(e){try{e?n.storage.setItem("debug",e):n.storage.removeItem("debug")}catch(e){}},n.load=function(){let e;try{e=n.storage.getItem("debug")}catch(e){}!e&&void 0!==i&&"env"in i&&(e=i.env.DEBUG);return e},n.useColors=function(){if("undefined"!=typeof window&&window.process&&("renderer"===window.process.type||window.process.__nwjs))return!0;if("undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;return"undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},n.storage=function(){try{return localStorage}catch(e){}}(),n.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),n.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],n.log=console.debug||console.log||(()=>{}),t.exports=e("./common")(n);const{formatters:r}=t.exports;r.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}}).call(this)}).call(this,e("_process"))},{"./common":30,_process:342}],30:[function(e,t,n){t.exports=function(t){function n(e){let t,r,s,o=null;function a(...e){if(!a.enabled)return;const i=a,r=Number(new Date),s=r-(t||r);i.diff=s,i.prev=t,i.curr=r,t=r,e[0]=n.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");let o=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,((t,r)=>{if("%%"===t)return"%";o++;const s=n.formatters[r];if("function"==typeof s){const n=e[o];t=s.call(i,n),e.splice(o,1),o--}return t})),n.formatArgs.call(i,e);(i.log||n.log).apply(i,e)}return a.namespace=e,a.useColors=n.useColors(),a.color=n.selectColor(e),a.extend=i,a.destroy=n.destroy,Object.defineProperty(a,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==o?o:(r!==n.namespaces&&(r=n.namespaces,s=n.enabled(e)),s),set:e=>{o=e}}),"function"==typeof n.init&&n.init(a),a}function i(e,t){const i=n(this.namespace+(void 0===t?":":t)+e);return i.log=this.log,i}function r(e){return e.toString().substring(2,e.toString().length-2).replace(/\.\*\?$/,"*")}return n.debug=n,n.default=n,n.coerce=function(e){if(e instanceof Error)return e.stack||e.message;return e},n.disable=function(){const e=[...n.names.map(r),...n.skips.map(r).map((e=>"-"+e))].join(",");return n.enable(""),e},n.enable=function(e){let t;n.save(e),n.namespaces=e,n.names=[],n.skips=[];const i=("string"==typeof e?e:"").split(/[\s,]+/),r=i.length;for(t=0;t{n[e]=t[e]})),n.names=[],n.skips=[],n.formatters={},n.selectColor=function(e){let t=0;for(let n=0;n=1.5*n;return Math.round(e/n)+" "+i+(r?"s":"")}t.exports=function(e,t){t=t||{};var n=typeof e;if("string"===n&&e.length>0)return function(e){if((e=String(e)).length>100)return;var t=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(!t)return;var n=parseFloat(t[1]);switch((t[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return n*c;case"weeks":case"week":case"w":return n*a;case"days":case"day":case"d":return n*o;case"hours":case"hour":case"hrs":case"hr":case"h":return n*s;case"minutes":case"minute":case"mins":case"min":case"m":return n*r;case"seconds":case"second":case"secs":case"sec":case"s":return n*i;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return n;default:return}}(e);if("number"===n&&isFinite(e))return t.long?function(e){var t=Math.abs(e);if(t>=o)return u(e,t,o,"day");if(t>=s)return u(e,t,s,"hour");if(t>=r)return u(e,t,r,"minute");if(t>=i)return u(e,t,i,"second");return e+" ms"}(e):function(e){var t=Math.abs(e);if(t>=o)return Math.round(e/o)+"d";if(t>=s)return Math.round(e/s)+"h";if(t>=r)return Math.round(e/r)+"m";if(t>=i)return Math.round(e/i)+"s";return e+"ms"}(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))}},{}],32:[function(e,t,n){"use strict";var i={};function r(e,t,n){n||(n=Error);var r=function(e){var n,i;function r(n,i,r){return e.call(this,function(e,n,i){return"string"==typeof t?t:t(e,n,i)}(n,i,r))||this}return i=e,(n=r).prototype=Object.create(i.prototype),n.prototype.constructor=n,n.__proto__=i,r}(n);r.prototype.name=n.name,r.prototype.code=e,i[e]=r}function s(e,t){if(Array.isArray(e)){var n=e.length;return e=e.map((function(e){return String(e)})),n>2?"one of ".concat(t," ").concat(e.slice(0,n-1).join(", "),", or ")+e[n-1]:2===n?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}return"of ".concat(t," ").concat(String(e))}r("ERR_INVALID_OPT_VALUE",(function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'}),TypeError),r("ERR_INVALID_ARG_TYPE",(function(e,t,n){var i,r,o,a;if("string"==typeof t&&(r="not ",t.substr(!o||o<0?0:+o,r.length)===r)?(i="must not be",t=t.replace(/^not /,"")):i="must be",function(e,t,n){return(void 0===n||n>e.length)&&(n=e.length),e.substring(n-t.length,n)===t}(e," argument"))a="The ".concat(e," ").concat(i," ").concat(s(t,"type"));else{var c=function(e,t,n){return"number"!=typeof n&&(n=0),!(n+t.length>e.length)&&-1!==e.indexOf(t,n)}(e,".")?"property":"argument";a='The "'.concat(e,'" ').concat(c," ").concat(i," ").concat(s(t,"type"))}return a+=". Received type ".concat(typeof n)}),TypeError),r("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),r("ERR_METHOD_NOT_IMPLEMENTED",(function(e){return"The "+e+" method is not implemented"})),r("ERR_STREAM_PREMATURE_CLOSE","Premature close"),r("ERR_STREAM_DESTROYED",(function(e){return"Cannot call "+e+" after a stream was destroyed"})),r("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),r("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),r("ERR_STREAM_WRITE_AFTER_END","write after end"),r("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),r("ERR_UNKNOWN_ENCODING",(function(e){return"Unknown encoding: "+e}),TypeError),r("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),t.exports.codes=i},{}],33:[function(e,t,n){(function(n){(function(){"use strict";var i=Object.keys||function(e){var t=[];for(var n in e)t.push(n);return t};t.exports=u;var r=e("./_stream_readable"),s=e("./_stream_writable");e("inherits")(u,r);for(var o=i(s.prototype),a=0;a0)if("string"==typeof t||o.objectMode||Object.getPrototypeOf(t)===a.prototype||(t=function(e){return a.from(e)}(t)),i)o.endEmitted?x(e,new w):A(e,o,t,!0);else if(o.ended)x(e,new y);else{if(o.destroyed)return!1;o.reading=!1,o.decoder&&!n?(t=o.decoder.write(t),o.objectMode||0!==t.length?A(e,o,t,!1):B(e,o)):A(e,o,t,!1)}else i||(o.reading=!1,B(e,o));return!o.ended&&(o.lengtht.highWaterMark&&(t.highWaterMark=function(e){return e>=I?e=I:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function j(e){var t=e._readableState;u("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(u("emitReadable",t.flowing),t.emittedReadable=!0,n.nextTick(C,e))}function C(e){var t=e._readableState;u("emitReadable_",t.destroyed,t.length,t.ended),t.destroyed||!t.length&&!t.ended||(e.emit("readable"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,U(e)}function B(e,t){t.readingMore||(t.readingMore=!0,n.nextTick(R,e,t))}function R(e,t){for(;!t.reading&&!t.ended&&(t.length0,t.resumeScheduled&&!t.paused?t.flowing=!0:e.listenerCount("data")>0&&e.resume()}function O(e){u("readable nexttick read 0"),e.read(0)}function P(e,t){u("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),U(e),t.flowing&&!t.reading&&e.read(0)}function U(e){var t=e._readableState;for(u("flow",t.flowing);t.flowing&&null!==e.read(););}function q(e,t){return 0===t.length?null:(t.objectMode?n=t.buffer.shift():!e||e>=t.length?(n=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.first():t.buffer.concat(t.length),t.buffer.clear()):n=t.buffer.consume(e,t.decoder),n);var n}function N(e){var t=e._readableState;u("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,n.nextTick(D,t,e))}function D(e,t){if(u("endReadableNT",e.endEmitted,e.length),!e.endEmitted&&0===e.length&&(e.endEmitted=!0,t.readable=!1,t.emit("end"),e.autoDestroy)){var n=t._writableState;(!n||n.autoDestroy&&n.finished)&&t.destroy()}}function z(e,t){for(var n=0,i=e.length;n=t.highWaterMark:t.length>0)||t.ended))return u("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?N(this):j(this),null;if(0===(e=T(e,t))&&t.ended)return 0===t.length&&N(this),null;var i,r=t.needReadable;return u("need readable",r),(0===t.length||t.length-e0?q(e,t):null)?(t.needReadable=t.length<=t.highWaterMark,e=0):(t.length-=e,t.awaitDrain=0),0===t.length&&(t.ended||(t.needReadable=!0),n!==e&&t.ended&&N(this)),null!==i&&this.emit("data",i),i},S.prototype._read=function(e){x(this,new _("_read()"))},S.prototype.pipe=function(e,t){var i=this,r=this._readableState;switch(r.pipesCount){case 0:r.pipes=e;break;case 1:r.pipes=[r.pipes,e];break;default:r.pipes.push(e)}r.pipesCount+=1,u("pipe count=%d opts=%j",r.pipesCount,t);var o=(!t||!1!==t.end)&&e!==n.stdout&&e!==n.stderr?c:b;function a(t,n){u("onunpipe"),t===i&&n&&!1===n.hasUnpiped&&(n.hasUnpiped=!0,u("cleanup"),e.removeListener("close",h),e.removeListener("finish",m),e.removeListener("drain",l),e.removeListener("error",p),e.removeListener("unpipe",a),i.removeListener("end",c),i.removeListener("end",b),i.removeListener("data",f),d=!0,!r.awaitDrain||e._writableState&&!e._writableState.needDrain||l())}function c(){u("onend"),e.end()}r.endEmitted?n.nextTick(o):i.once("end",o),e.on("unpipe",a);var l=function(e){return function(){var t=e._readableState;u("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&s(e,"data")&&(t.flowing=!0,U(e))}}(i);e.on("drain",l);var d=!1;function f(t){u("ondata");var n=e.write(t);u("dest.write",n),!1===n&&((1===r.pipesCount&&r.pipes===e||r.pipesCount>1&&-1!==z(r.pipes,e))&&!d&&(u("false write response, pause",r.awaitDrain),r.awaitDrain++),i.pause())}function p(t){u("onerror",t),b(),e.removeListener("error",p),0===s(e,"error")&&x(e,t)}function h(){e.removeListener("finish",m),b()}function m(){u("onfinish"),e.removeListener("close",h),b()}function b(){u("unpipe"),i.unpipe(e)}return i.on("data",f),function(e,t,n){if("function"==typeof e.prependListener)return e.prependListener(t,n);e._events&&e._events[t]?Array.isArray(e._events[t])?e._events[t].unshift(n):e._events[t]=[n,e._events[t]]:e.on(t,n)}(e,"error",p),e.once("close",h),e.once("finish",m),e.emit("pipe",i),r.flowing||(u("pipe resume"),i.resume()),e},S.prototype.unpipe=function(e){var t=this._readableState,n={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes||(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,n)),this;if(!e){var i=t.pipes,r=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var s=0;s0,!1!==r.flowing&&this.resume()):"readable"===e&&(r.endEmitted||r.readableListening||(r.readableListening=r.needReadable=!0,r.flowing=!1,r.emittedReadable=!1,u("on readable",r.length,r.reading),r.length?j(this):r.reading||n.nextTick(O,this))),i},S.prototype.addListener=S.prototype.on,S.prototype.removeListener=function(e,t){var i=o.prototype.removeListener.call(this,e,t);return"readable"===e&&n.nextTick(L,this),i},S.prototype.removeAllListeners=function(e){var t=o.prototype.removeAllListeners.apply(this,arguments);return"readable"!==e&&void 0!==e||n.nextTick(L,this),t},S.prototype.resume=function(){var e=this._readableState;return e.flowing||(u("resume"),e.flowing=!e.readableListening,function(e,t){t.resumeScheduled||(t.resumeScheduled=!0,n.nextTick(P,e,t))}(this,e)),e.paused=!1,this},S.prototype.pause=function(){return u("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(u("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},S.prototype.wrap=function(e){var t=this,n=this._readableState,i=!1;for(var r in e.on("end",(function(){if(u("wrapped end"),n.decoder&&!n.ended){var e=n.decoder.end();e&&e.length&&t.push(e)}t.push(null)})),e.on("data",(function(r){(u("wrapped data"),n.decoder&&(r=n.decoder.write(r)),n.objectMode&&null==r)||(n.objectMode||r&&r.length)&&(t.push(r)||(i=!0,e.pause()))})),e)void 0===this[r]&&"function"==typeof e[r]&&(this[r]=function(t){return function(){return e[t].apply(e,arguments)}}(r));for(var s=0;s-1))throw new w(e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(S.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(S.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),S.prototype._write=function(e,t,n){n(new m("_write()"))},S.prototype._writev=null,S.prototype.end=function(e,t,i){var r=this._writableState;return"function"==typeof e?(i=e,e=null,t=null):"function"==typeof t&&(i=t,t=null),null!=e&&this.write(e,t),r.corked&&(r.corked=1,this.uncork()),r.ending||function(e,t,i){t.ending=!0,C(e,t),i&&(t.finished?n.nextTick(i):e.once("finish",i));t.ended=!0,e.writable=!1}(this,r,i),this},Object.defineProperty(S.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(S.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),S.prototype.destroy=d.destroy,S.prototype._undestroy=d.undestroy,S.prototype._destroy=function(e,t){t(e)}}).call(this)}).call(this,e("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../errors":32,"./_stream_duplex":33,"./internal/streams/destroy":40,"./internal/streams/state":44,"./internal/streams/stream":45,_process:342,buffer:116,inherits:249,"util-deprecate":500}],38:[function(e,t,n){(function(n){(function(){"use strict";var i;function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var s=e("./end-of-stream"),o=Symbol("lastResolve"),a=Symbol("lastReject"),c=Symbol("error"),u=Symbol("ended"),l=Symbol("lastPromise"),d=Symbol("handlePromise"),f=Symbol("stream");function p(e,t){return{value:e,done:t}}function h(e){var t=e[o];if(null!==t){var n=e[f].read();null!==n&&(e[l]=null,e[o]=null,e[a]=null,t(p(n,!1)))}}function m(e){n.nextTick(h,e)}var b=Object.getPrototypeOf((function(){})),g=Object.setPrototypeOf((r(i={get stream(){return this[f]},next:function(){var e=this,t=this[c];if(null!==t)return Promise.reject(t);if(this[u])return Promise.resolve(p(void 0,!0));if(this[f].destroyed)return new Promise((function(t,i){n.nextTick((function(){e[c]?i(e[c]):t(p(void 0,!0))}))}));var i,r=this[l];if(r)i=new Promise(function(e,t){return function(n,i){e.then((function(){t[u]?n(p(void 0,!0)):t[d](n,i)}),i)}}(r,this));else{var s=this[f].read();if(null!==s)return Promise.resolve(p(s,!1));i=new Promise(this[d])}return this[l]=i,i}},Symbol.asyncIterator,(function(){return this})),r(i,"return",(function(){var e=this;return new Promise((function(t,n){e[f].destroy(null,(function(e){e?n(e):t(p(void 0,!0))}))}))})),i),b);t.exports=function(e){var t,n=Object.create(g,(r(t={},f,{value:e,writable:!0}),r(t,o,{value:null,writable:!0}),r(t,a,{value:null,writable:!0}),r(t,c,{value:null,writable:!0}),r(t,u,{value:e._readableState.endEmitted,writable:!0}),r(t,d,{value:function(e,t){var i=n[f].read();i?(n[l]=null,n[o]=null,n[a]=null,e(p(i,!1))):(n[o]=e,n[a]=t)},writable:!0}),t));return n[l]=null,s(e,(function(e){if(e&&"ERR_STREAM_PREMATURE_CLOSE"!==e.code){var t=n[a];return null!==t&&(n[l]=null,n[o]=null,n[a]=null,t(e)),void(n[c]=e)}var i=n[o];null!==i&&(n[l]=null,n[o]=null,n[a]=null,i(p(void 0,!0))),n[u]=!0})),e.on("readable",m.bind(null,n)),n}}).call(this)}).call(this,e("_process"))},{"./end-of-stream":41,_process:342}],39:[function(e,t,n){"use strict";function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function s(e,t){for(var n=0;n0?this.tail.next=t:this.head=t,this.tail=t,++this.length}},{key:"unshift",value:function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length}},{key:"shift",value:function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(e){if(0===this.length)return"";for(var t=this.head,n=""+t.data;t=t.next;)n+=e+t.data;return n}},{key:"concat",value:function(e){if(0===this.length)return o.alloc(0);for(var t,n,i,r=o.allocUnsafe(e>>>0),s=this.head,a=0;s;)t=s.data,n=r,i=a,o.prototype.copy.call(t,n,i),a+=s.data.length,s=s.next;return r}},{key:"consume",value:function(e,t){var n;return er.length?r.length:e;if(s===r.length?i+=r:i+=r.slice(0,e),0==(e-=s)){s===r.length?(++n,t.next?this.head=t.next:this.head=this.tail=null):(this.head=t,t.data=r.slice(s));break}++n}return this.length-=n,i}},{key:"_getBuffer",value:function(e){var t=o.allocUnsafe(e),n=this.head,i=1;for(n.data.copy(t),e-=n.data.length;n=n.next;){var r=n.data,s=e>r.length?r.length:e;if(r.copy(t,t.length-e,0,s),0==(e-=s)){s===r.length?(++i,n.next?this.head=n.next:this.head=this.tail=null):(this.head=n,n.data=r.slice(s));break}++i}return this.length-=i,t}},{key:c,value:function(e,t){return a(this,function(e){for(var t=1;t0,(function(e){i||(i=e),e&&o.forEach(u),s||(o.forEach(u),r(i))}))}));return t.reduce(l)}},{"../../../errors":32,"./end-of-stream":41}],44:[function(e,t,n){"use strict";var i=e("../../../errors").codes.ERR_INVALID_OPT_VALUE;t.exports={getHighWaterMark:function(e,t,n,r){var s=function(e,t,n){return null!=e.highWaterMark?e.highWaterMark:t?e[n]:null}(t,r,n);if(null!=s){if(!isFinite(s)||Math.floor(s)!==s||s<0)throw new i(r?n:"highWaterMark",s);return Math.floor(s)}return e.objectMode?16:16384}}},{"../../../errors":32}],45:[function(e,t,n){t.exports=e("events").EventEmitter},{events:196}],46:[function(e,t,n){(n=t.exports=e("./lib/_stream_readable.js")).Stream=n,n.Readable=n,n.Writable=e("./lib/_stream_writable.js"),n.Duplex=e("./lib/_stream_duplex.js"),n.Transform=e("./lib/_stream_transform.js"),n.PassThrough=e("./lib/_stream_passthrough.js"),n.finished=e("./lib/internal/streams/end-of-stream.js"),n.pipeline=e("./lib/internal/streams/pipeline.js")},{"./lib/_stream_duplex.js":33,"./lib/_stream_passthrough.js":34,"./lib/_stream_readable.js":35,"./lib/_stream_transform.js":36,"./lib/_stream_writable.js":37,"./lib/internal/streams/end-of-stream.js":41,"./lib/internal/streams/pipeline.js":43}],47:[function(e,t,n){(function(n,i){(function(){const r=e("debug")("bittorrent-tracker:client"),s=e("events"),o=e("once"),a=e("run-parallel"),c=e("simple-peer"),u=e("queue-microtask"),l=e("./lib/common"),d=e("./lib/client/http-tracker"),f=e("./lib/client/udp-tracker"),p=e("./lib/client/websocket-tracker");class h extends s{constructor(e={}){if(super(),!e.peerId)throw new Error("Option `peerId` is required");if(!e.infoHash)throw new Error("Option `infoHash` is required");if(!e.announce)throw new Error("Option `announce` is required");if(!n.browser&&!e.port)throw new Error("Option `port` is required");this.peerId="string"==typeof e.peerId?e.peerId:e.peerId.toString("hex"),this._peerIdBuffer=i.from(this.peerId,"hex"),this._peerIdBinary=this._peerIdBuffer.toString("binary"),this.infoHash="string"==typeof e.infoHash?e.infoHash.toLowerCase():e.infoHash.toString("hex"),this._infoHashBuffer=i.from(this.infoHash,"hex"),this._infoHashBinary=this._infoHashBuffer.toString("binary"),r("new client %s",this.infoHash),this.destroyed=!1,this._port=e.port,this._getAnnounceOpts=e.getAnnounceOpts,this._rtcConfig=e.rtcConfig,this._userAgent=e.userAgent,this._wrtc="function"==typeof e.wrtc?e.wrtc():e.wrtc;let t="string"==typeof e.announce?[e.announce]:null==e.announce?[]:e.announce;t=t.map((e=>("/"===(e=e.toString())[e.length-1]&&(e=e.substring(0,e.length-1)),e))),t=Array.from(new Set(t));const s=!1!==this._wrtc&&(!!this._wrtc||c.WEBRTC_SUPPORT),o=e=>{u((()=>{this.emit("warning",e)}))};this._trackers=t.map((e=>{let t;try{t=l.parseUrl(e)}catch(t){return o(new Error(`Invalid tracker URL: ${e}`)),null}const n=t.port;if(n<0||n>65535)return o(new Error(`Invalid tracker port: ${e}`)),null;const i=t.protocol;return"http:"!==i&&"https:"!==i||"function"!=typeof d?"udp:"===i&&"function"==typeof f?new f(this,e):"ws:"!==i&&"wss:"!==i||!s||"ws:"===i&&"undefined"!=typeof window&&"https:"===window.location.protocol?(o(new Error(`Unsupported tracker protocol: ${e}`)),null):new p(this,e):new d(this,e)})).filter(Boolean)}start(e){(e=this._defaultAnnounceOpts(e)).event="started",r("send `start` %o",e),this._announce(e),this._trackers.forEach((e=>{e.setInterval()}))}stop(e){(e=this._defaultAnnounceOpts(e)).event="stopped",r("send `stop` %o",e),this._announce(e)}complete(e){e||(e={}),(e=this._defaultAnnounceOpts(e)).event="completed",r("send `complete` %o",e),this._announce(e)}update(e){(e=this._defaultAnnounceOpts(e)).event&&delete e.event,r("send `update` %o",e),this._announce(e)}_announce(e){this._trackers.forEach((t=>{t.announce(e)}))}scrape(e){r("send `scrape`"),e||(e={}),this._trackers.forEach((t=>{t.scrape(e)}))}setInterval(e){r("setInterval %d",e),this._trackers.forEach((t=>{t.setInterval(e)}))}destroy(e){if(this.destroyed)return;this.destroyed=!0,r("destroy");const t=this._trackers.map((e=>t=>{e.destroy(t)}));a(t,e),this._trackers=[],this._getAnnounceOpts=null}_defaultAnnounceOpts(e={}){return null==e.numwant&&(e.numwant=l.DEFAULT_ANNOUNCE_PEERS),null==e.uploaded&&(e.uploaded=0),null==e.downloaded&&(e.downloaded=0),this._getAnnounceOpts&&(e=Object.assign({},e,this._getAnnounceOpts())),e}}h.scrape=(e,t)=>{if(t=o(t),!e.infoHash)throw new Error("Option `infoHash` is required");if(!e.announce)throw new Error("Option `announce` is required");const n=Object.assign({},e,{infoHash:Array.isArray(e.infoHash)?e.infoHash[0]:e.infoHash,peerId:i.from("01234567890123456789"),port:6881}),r=new h(n);r.once("error",t),r.once("warning",t);let s=Array.isArray(e.infoHash)?e.infoHash.length:1;const a={};return r.on("scrape",(e=>{if(s-=1,a[e.infoHash]=e,0===s){r.destroy();const e=Object.keys(a);1===e.length?t(null,a[e[0]]):t(null,a)}})),e.infoHash=Array.isArray(e.infoHash)?e.infoHash.map((e=>i.from(e,"hex"))):i.from(e.infoHash,"hex"),r.scrape({infoHash:e.infoHash}),r},t.exports=h}).call(this)}).call(this,e("_process"),e("buffer").Buffer)},{"./lib/client/http-tracker":73,"./lib/client/udp-tracker":73,"./lib/client/websocket-tracker":49,"./lib/common":50,_process:342,buffer:116,debug:51,events:196,once:327,"queue-microtask":355,"run-parallel":384,"simple-peer":398}],48:[function(e,t,n){const i=e("events");t.exports=class extends i{constructor(e,t){super(),this.client=e,this.announceUrl=t,this.interval=null,this.destroyed=!1}setInterval(e){null==e&&(e=this.DEFAULT_ANNOUNCE_INTERVAL),clearInterval(this.interval),e&&(this.interval=setInterval((()=>{this.announce(this.client._defaultAnnounceOpts())}),e),this.interval.unref&&this.interval.unref())}}},{events:196}],49:[function(e,t,n){const i=e("debug")("bittorrent-tracker:websocket-tracker"),r=e("simple-peer"),s=e("randombytes"),o=e("simple-websocket"),a=e("../common"),c=e("./tracker"),u={};class l extends c{constructor(e,t){super(e,t),i("new websocket tracker %s",t),this.peers={},this.socket=null,this.reconnecting=!1,this.retries=0,this.reconnectTimer=null,this.expectingResponse=!1,this._openSocket()}announce(e){if(this.destroyed||this.reconnecting)return;if(!this.socket.connected)return void this.socket.once("connect",(()=>{this.announce(e)}));const t=Object.assign({},e,{action:"announce",info_hash:this.client._infoHashBinary,peer_id:this.client._peerIdBinary});if(this._trackerId&&(t.trackerid=this._trackerId),"stopped"===e.event||"completed"===e.event)this._send(t);else{const n=Math.min(e.numwant,5);this._generateOffers(n,(e=>{t.numwant=n,t.offers=e,this._send(t)}))}}scrape(e){if(this.destroyed||this.reconnecting)return;if(!this.socket.connected)return void this.socket.once("connect",(()=>{this.scrape(e)}));const t={action:"scrape",info_hash:Array.isArray(e.infoHash)&&e.infoHash.length>0?e.infoHash.map((e=>e.toString("binary"))):e.infoHash&&e.infoHash.toString("binary")||this.client._infoHashBinary};this._send(t)}destroy(e=d){if(this.destroyed)return e(null);this.destroyed=!0,clearInterval(this.interval),clearTimeout(this.reconnectTimer);for(const e in this.peers){const t=this.peers[e];clearTimeout(t.trackerTimeout),t.destroy()}if(this.peers=null,this.socket&&(this.socket.removeListener("connect",this._onSocketConnectBound),this.socket.removeListener("data",this._onSocketDataBound),this.socket.removeListener("close",this._onSocketCloseBound),this.socket.removeListener("error",this._onSocketErrorBound),this.socket=null),this._onSocketConnectBound=null,this._onSocketErrorBound=null,this._onSocketDataBound=null,this._onSocketCloseBound=null,u[this.announceUrl]&&(u[this.announceUrl].consumers-=1),u[this.announceUrl].consumers>0)return e();let t,n=u[this.announceUrl];if(delete u[this.announceUrl],n.on("error",d),n.once("close",e),!this.expectingResponse)return i();function i(){t&&(clearTimeout(t),t=null),n.removeListener("data",i),n.destroy(),n=null}t=setTimeout(i,a.DESTROY_TIMEOUT),n.once("data",i)}_openSocket(){this.destroyed=!1,this.peers||(this.peers={}),this._onSocketConnectBound=()=>{this._onSocketConnect()},this._onSocketErrorBound=e=>{this._onSocketError(e)},this._onSocketDataBound=e=>{this._onSocketData(e)},this._onSocketCloseBound=()=>{this._onSocketClose()},this.socket=u[this.announceUrl],this.socket?(u[this.announceUrl].consumers+=1,this.socket.connected&&this._onSocketConnectBound()):(this.socket=u[this.announceUrl]=new o(this.announceUrl),this.socket.consumers=1,this.socket.once("connect",this._onSocketConnectBound)),this.socket.on("data",this._onSocketDataBound),this.socket.once("close",this._onSocketCloseBound),this.socket.once("error",this._onSocketErrorBound)}_onSocketConnect(){this.destroyed||this.reconnecting&&(this.reconnecting=!1,this.retries=0,this.announce(this.client._defaultAnnounceOpts()))}_onSocketData(e){if(!this.destroyed){this.expectingResponse=!1;try{e=JSON.parse(e)}catch(e){return void this.client.emit("warning",new Error("Invalid tracker response"))}"announce"===e.action?this._onAnnounceResponse(e):"scrape"===e.action?this._onScrapeResponse(e):this._onSocketError(new Error(`invalid action in WS response: ${e.action}`))}}_onAnnounceResponse(e){if(e.info_hash!==this.client._infoHashBinary)return void i("ignoring websocket data from %s for %s (looking for %s: reused socket)",this.announceUrl,a.binaryToHex(e.info_hash),this.client.infoHash);if(e.peer_id&&e.peer_id===this.client._peerIdBinary)return;i("received %s from %s for %s",JSON.stringify(e),this.announceUrl,this.client.infoHash);const t=e["failure reason"];if(t)return this.client.emit("warning",new Error(t));const n=e["warning message"];n&&this.client.emit("warning",new Error(n));const r=e.interval||e["min interval"];r&&this.setInterval(1e3*r);const s=e["tracker id"];if(s&&(this._trackerId=s),null!=e.complete){const t=Object.assign({},e,{announce:this.announceUrl,infoHash:a.binaryToHex(e.info_hash)});this.client.emit("update",t)}let o;if(e.offer&&e.peer_id&&(i("creating peer (from remote offer)"),o=this._createPeer(),o.id=a.binaryToHex(e.peer_id),o.once("signal",(t=>{const n={action:"announce",info_hash:this.client._infoHashBinary,peer_id:this.client._peerIdBinary,to_peer_id:e.peer_id,answer:t,offer_id:e.offer_id};this._trackerId&&(n.trackerid=this._trackerId),this._send(n)})),this.client.emit("peer",o),o.signal(e.offer)),e.answer&&e.peer_id){const t=a.binaryToHex(e.offer_id);o=this.peers[t],o?(o.id=a.binaryToHex(e.peer_id),this.client.emit("peer",o),o.signal(e.answer),clearTimeout(o.trackerTimeout),o.trackerTimeout=null,delete this.peers[t]):i(`got unexpected answer: ${JSON.stringify(e.answer)}`)}}_onScrapeResponse(e){e=e.files||{};const t=Object.keys(e);0!==t.length?t.forEach((t=>{const n=Object.assign(e[t],{announce:this.announceUrl,infoHash:a.binaryToHex(t)});this.client.emit("scrape",n)})):this.client.emit("warning",new Error("invalid scrape response"))}_onSocketClose(){this.destroyed||(this.destroy(),this._startReconnectTimer())}_onSocketError(e){this.destroyed||(this.destroy(),this.client.emit("warning",e),this._startReconnectTimer())}_startReconnectTimer(){const e=Math.floor(3e5*Math.random())+Math.min(1e4*Math.pow(2,this.retries),36e5);this.reconnecting=!0,clearTimeout(this.reconnectTimer),this.reconnectTimer=setTimeout((()=>{this.retries++,this._openSocket()}),e),this.reconnectTimer.unref&&this.reconnectTimer.unref(),i("reconnecting socket in %s ms",e)}_send(e){if(this.destroyed)return;this.expectingResponse=!0;const t=JSON.stringify(e);i("send %s",t),this.socket.send(t)}_generateOffers(e,t){const n=this,r=[];i("generating %s offers",e);for(let t=0;t{r.push({offer:t,offer_id:a.hexToBinary(e)}),c()})),t.trackerTimeout=setTimeout((()=>{i("tracker timeout: destroying peer"),t.trackerTimeout=null,delete n.peers[e],t.destroy()}),5e4),t.trackerTimeout.unref&&t.trackerTimeout.unref()}function c(){r.length===e&&(i("generated %s offers",e),t(r))}c()}_createPeer(e){const t=this;e=Object.assign({trickle:!1,config:t.client._rtcConfig,wrtc:t.client._wrtc},e);const n=new r(e);return n.once("error",i),n.once("connect",(function e(){n.removeListener("error",i),n.removeListener("connect",e)})),n;function i(e){t.client.emit("warning",new Error(`Connection error: ${e.message}`)),n.destroy()}}}function d(){}l.prototype.DEFAULT_ANNOUNCE_INTERVAL=3e4,l._socketPool=u,t.exports=l},{"../common":50,"./tracker":48,debug:51,randombytes:358,"simple-peer":398,"simple-websocket":419}],50:[function(e,t,n){(function(t){(function(){n.DEFAULT_ANNOUNCE_PEERS=50,n.MAX_ANNOUNCE_PEERS=82,n.binaryToHex=e=>("string"!=typeof e&&(e=String(e)),t.from(e,"binary").toString("hex")),n.hexToBinary=e=>("string"!=typeof e&&(e=String(e)),t.from(e,"hex").toString("binary")),n.parseUrl=e=>{const t=new URL(e.replace(/^udp:/,"http:"));return e.match(/^udp:/)&&Object.defineProperties(t,{href:{value:t.href.replace(/^http/,"udp")},protocol:{value:t.protocol.replace(/^http/,"udp")},origin:{value:t.origin.replace(/^http/,"udp")}}),t};const i=e("./common-node");Object.assign(n,i)}).call(this)}).call(this,e("buffer").Buffer)},{"./common-node":73,buffer:116}],51:[function(e,t,n){arguments[4][29][0].apply(n,arguments)},{"./common":52,_process:342,dup:29}],52:[function(e,t,n){arguments[4][30][0].apply(n,arguments)},{dup:30,ms:53}],53:[function(e,t,n){arguments[4][31][0].apply(n,arguments)},{dup:31}],54:[function(e,t,n){(function(e){(function(){ +const n=e("unordered-array-remove"),r=e("bencode"),s=e("bitfield").default,a=e("crypto"),o=e("debug")("bittorrent-protocol"),c=e("randombytes"),l=e("simple-sha1"),u=e("speedometer"),p=e("readable-stream"),d=e("rc4"),f=i.from("BitTorrent protocol"),h=i.from([0,0,0,0]),m=i.from([0,0,0,1,0]),b=i.from([0,0,0,1,1]),v=i.from([0,0,0,1,2]),g=i.from([0,0,0,1,3]),y=[0,0,0,0,0,0,0,0],_=[0,0,0,3,9,0,0],x=i.from([0,0,0,0,0,0,0,0]),w=i.from([0,0,1,2]),k=i.from([0,0,0,2]);function E(e,t){for(let i=e.length;i--;)e[i]^=t[i];return e}class S{constructor(e,t,i,n){this.piece=e,this.offset=t,this.length=i,this.callback=n}}class M extends p.Duplex{constructor(e=null,t=0,i=!1){super(),this._debugId=c(4).toString("hex"),this._debug("new wire"),this.peerId=null,this.peerIdBuffer=null,this.type=e,this.amChoking=!0,this.amInterested=!1,this.peerChoking=!0,this.peerInterested=!1,this.peerPieces=new s(0,{grow:4e5}),this.peerExtensions={},this.requests=[],this.peerRequests=[],this.extendedMapping={},this.peerExtendedMapping={},this.extendedHandshake={},this.peerExtendedHandshake={},this._ext={},this._nextExt=1,this.uploaded=0,this.downloaded=0,this.uploadSpeed=u(),this.downloadSpeed=u(),this._keepAliveInterval=null,this._timeout=null,this._timeoutMs=0,this._timeoutExpiresAt=null,this.destroyed=!1,this._finished=!1,this._parserSize=0,this._parser=null,this._buffer=[],this._bufferSize=0,this._peEnabled=i,i?(this._dh=a.createDiffieHellman("ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a63a36210000000000090563","hex",2),this._myPubKey=this._dh.generateKeys("hex")):this._myPubKey=null,this._peerPubKey=null,this._sharedSecret=null,this._peerCryptoProvide=[],this._cryptoHandshakeDone=!1,this._cryptoSyncPattern=null,this._waitMaxBytes=null,this._encryptionMethod=null,this._encryptGenerator=null,this._decryptGenerator=null,this._setGenerators=!1,this.once("finish",(()=>this._onFinish())),this.on("finish",this._onFinish),this._debug("type:",this.type),"tcpIncoming"===this.type&&this._peEnabled?this._determineHandshakeType():"tcpOutgoing"===this.type&&this._peEnabled&&0===t?this._parsePe2():this._parseHandshake(null)}setKeepAlive(e){this._debug("setKeepAlive %s",e),clearInterval(this._keepAliveInterval),!1!==e&&(this._keepAliveInterval=setInterval((()=>{this.keepAlive()}),55e3))}setTimeout(e,t){this._debug("setTimeout ms=%d unref=%s",e,t),this._timeoutMs=e,this._timeoutUnref=!!t,this._resetTimeout(!0)}destroy(){this.destroyed||(this.destroyed=!0,this._debug("destroy"),this.emit("close"),this.end())}end(...e){this._debug("end"),this._onUninterested(),this._onChoke(),super.end(...e)}use(e){const t=e.prototype.name;if(!t)throw new Error('Extension class requires a "name" property on the prototype');this._debug("use extension.name=%s",t);const i=this._nextExt,n=new e(this);function r(){}"function"!=typeof n.onHandshake&&(n.onHandshake=r),"function"!=typeof n.onExtendedHandshake&&(n.onExtendedHandshake=r),"function"!=typeof n.onMessage&&(n.onMessage=r),this.extendedMapping[i]=t,this._ext[t]=n,this[t]=n,this._nextExt+=1}keepAlive(){this._debug("keep-alive"),this._push(h)}sendPe1(){if(this._peEnabled){const e=Math.floor(513*Math.random()),t=c(e);this._push(i.concat([i.from(this._myPubKey,"hex"),t]))}}sendPe2(){const e=Math.floor(513*Math.random()),t=c(e);this._push(i.concat([i.from(this._myPubKey,"hex"),t]))}sendPe3(e){this.setEncrypt(this._sharedSecret,e);const t=i.from(l.sync(i.from(this._utfToHex("req1")+this._sharedSecret,"hex")),"hex"),n=E(i.from(l.sync(i.from(this._utfToHex("req2")+e,"hex")),"hex"),i.from(l.sync(i.from(this._utfToHex("req3")+this._sharedSecret,"hex")),"hex")),r=c(2).readUInt16BE(0)%512,s=c(r);let a=i.alloc(14+r+2);x.copy(a),w.copy(a,8),a.writeInt16BE(r,12),s.copy(a,14),a.writeInt16BE(0,14+r),a=this._encryptHandshake(a),this._push(i.concat([t,n,a]))}sendPe4(e){this.setEncrypt(this._sharedSecret,e);const t=c(2).readUInt16BE(0)%512,n=c(t);let r=i.alloc(14+t);x.copy(r),k.copy(r,8),r.writeInt16BE(t,12),n.copy(r,14),r=this._encryptHandshake(r),this._push(r),this._cryptoHandshakeDone=!0,this._debug("completed crypto handshake")}handshake(e,t,n){let r,s;if("string"==typeof e?(e=e.toLowerCase(),r=i.from(e,"hex")):(r=e,e=r.toString("hex")),"string"==typeof t?s=i.from(t,"hex"):(s=t,t=s.toString("hex")),this._infoHash=r,20!==r.length||20!==s.length)throw new Error("infoHash and peerId MUST have length 20");this._debug("handshake i=%s p=%s exts=%o",e,t,n);const a=i.from(y);a[5]|=16,n&&n.dht&&(a[7]|=1),this._push(i.concat([f,a,r,s])),this._handshakeSent=!0,this.peerExtensions.extended&&!this._extendedHandshakeSent&&this._sendExtendedHandshake()}_sendExtendedHandshake(){const e=Object.assign({},this.extendedHandshake);e.m={};for(const t in this.extendedMapping){const i=this.extendedMapping[t];e.m[i]=Number(t)}this.extended(0,r.encode(e)),this._extendedHandshakeSent=!0}choke(){if(!this.amChoking){for(this.amChoking=!0,this._debug("choke");this.peerRequests.length;)this.peerRequests.pop();this._push(m)}}unchoke(){this.amChoking&&(this.amChoking=!1,this._debug("unchoke"),this._push(b))}interested(){this.amInterested||(this.amInterested=!0,this._debug("interested"),this._push(v))}uninterested(){this.amInterested&&(this.amInterested=!1,this._debug("uninterested"),this._push(g))}have(e){this._debug("have %d",e),this._message(4,[e],null)}bitfield(e){this._debug("bitfield"),i.isBuffer(e)||(e=e.buffer),this._message(5,[],e)}request(e,t,i,n){return n||(n=()=>{}),this._finished?n(new Error("wire is closed")):this.peerChoking?n(new Error("peer is choking")):(this._debug("request index=%d offset=%d length=%d",e,t,i),this.requests.push(new S(e,t,i,n)),this._timeout||this._resetTimeout(!0),void this._message(6,[e,t,i],null))}piece(e,t,i){this._debug("piece index=%d offset=%d",e,t),this._message(7,[e,t],i),this.uploaded+=i.length,this.uploadSpeed(i.length),this.emit("upload",i.length)}cancel(e,t,i){this._debug("cancel index=%d offset=%d length=%d",e,t,i),this._callback(this._pull(this.requests,e,t,i),new Error("request was cancelled"),null),this._message(8,[e,t,i],null)}port(e){this._debug("port %d",e);const t=i.from(_);t.writeUInt16BE(e,5),this._push(t)}extended(e,t){if(this._debug("extended ext=%s",e),"string"==typeof e&&this.peerExtendedMapping[e]&&(e=this.peerExtendedMapping[e]),"number"!=typeof e)throw new Error(`Unrecognized extension: ${e}`);{const n=i.from([e]),s=i.isBuffer(t)?t:r.encode(t);this._message(20,[],i.concat([n,s]))}}setEncrypt(e,t){let n,r,s,a,o,c;switch(this.type){case"tcpIncoming":n=l.sync(i.from(this._utfToHex("keyB")+e+t,"hex")),r=l.sync(i.from(this._utfToHex("keyA")+e+t,"hex")),s=i.from(n,"hex"),a=[];for(const e of s.values())a.push(e);o=i.from(r,"hex"),c=[];for(const e of o.values())c.push(e);this._encryptGenerator=new d(a),this._decryptGenerator=new d(c);break;case"tcpOutgoing":n=l.sync(i.from(this._utfToHex("keyA")+e+t,"hex")),r=l.sync(i.from(this._utfToHex("keyB")+e+t,"hex")),s=i.from(n,"hex"),a=[];for(const e of s.values())a.push(e);o=i.from(r,"hex"),c=[];for(const e of o.values())c.push(e);this._encryptGenerator=new d(a),this._decryptGenerator=new d(c);break;default:return!1}for(let e=0;e<1024;e++)this._encryptGenerator.randomByte(),this._decryptGenerator.randomByte();return this._setGenerators=!0,!0}_read(){}_message(e,t,n){const r=n?n.length:0,s=i.allocUnsafe(5+4*t.length);s.writeUInt32BE(s.length+r-4,0),s[4]=e;for(let e=0;e{if(r===this._pull(this.peerRequests,e,t,i))return n?this._debug("error satisfying request index=%d offset=%d length=%d (%s)",e,t,i,n.message):void this.piece(e,t,s)},r=new S(e,t,i,n);this.peerRequests.push(r),this.emit("request",e,t,i,n)}_onPiece(e,t,i){this._debug("got piece index=%d offset=%d",e,t),this._callback(this._pull(this.requests,e,t,i.length),null,i),this.downloaded+=i.length,this.downloadSpeed(i.length),this.emit("download",i.length),this.emit("piece",e,t,i)}_onCancel(e,t,i){this._debug("got cancel index=%d offset=%d length=%d",e,t,i),this._pull(this.peerRequests,e,t,i),this.emit("cancel",e,t,i)}_onPort(e){this._debug("got port %d",e),this.emit("port",e)}_onExtended(e,t){if(0===e){let e;try{e=r.decode(t)}catch(e){this._debug("ignoring invalid extended handshake: %s",e.message||e)}if(!e)return;if(this.peerExtendedHandshake=e,"object"==typeof e.m)for(const t in e.m)this.peerExtendedMapping[t]=Number(e.m[t].toString());for(const e in this._ext)this.peerExtendedMapping[e]&&this._ext[e].onExtendedHandshake(this.peerExtendedHandshake);this._debug("got extended handshake"),this.emit("extended","handshake",this.peerExtendedHandshake)}else this.extendedMapping[e]&&(e=this.extendedMapping[e],this._ext[e]&&this._ext[e].onMessage(t)),this._debug("got extended message ext=%s",e),this.emit("extended",e,t)}_onTimeout(){this._debug("request timed out"),this._callback(this.requests.shift(),new Error("request has timed out"),null),this.emit("timeout")}_write(e,t,n){if(2===this._encryptionMethod&&this._cryptoHandshakeDone&&(e=this._decrypt(e)),this._bufferSize+=e.length,this._buffer.push(e),this._buffer.length>1&&(this._buffer=[i.concat(this._buffer,this._bufferSize)]),this._cryptoSyncPattern){const t=this._buffer[0].indexOf(this._cryptoSyncPattern);if(-1!==t)this._buffer[0]=this._buffer[0].slice(t+this._cryptoSyncPattern.length),this._bufferSize-=t+this._cryptoSyncPattern.length,this._cryptoSyncPattern=null;else if(this._bufferSize+e.length>this._waitMaxBytes+this._cryptoSyncPattern.length)return this._debug("Error: could not resynchronize"),void this.destroy()}for(;this._bufferSize>=this._parserSize&&!this._cryptoSyncPattern;)if(0===this._parserSize)this._parser(i.from([]));else{const e=this._buffer[0];this._bufferSize-=this._parserSize,this._buffer=this._bufferSize?[e.slice(this._parserSize)]:[],this._parser(e.slice(0,this._parserSize))}n(null)}_callback(e,t,i){e&&(this._resetTimeout(!this.peerChoking&&!this._finished),e.callback(t,i))}_resetTimeout(e){if(!e||!this._timeoutMs||!this.requests.length)return clearTimeout(this._timeout),this._timeout=null,void(this._timeoutExpiresAt=null);const t=Date.now()+this._timeoutMs;if(this._timeout){if(t-this._timeoutExpiresAt<.05*this._timeoutMs)return;clearTimeout(this._timeout)}this._timeoutExpiresAt=t,this._timeout=setTimeout((()=>this._onTimeout()),this._timeoutMs),this._timeoutUnref&&this._timeout.unref&&this._timeout.unref()}_parse(e,t){this._parserSize=e,this._parser=t}_parseUntil(e,t){this._cryptoSyncPattern=e,this._waitMaxBytes=t}_onMessageLength(e){const t=e.readUInt32BE(0);t>0?this._parse(t,this._onMessage):(this._onKeepAlive(),this._parse(4,this._onMessageLength))}_onMessage(e){switch(this._parse(4,this._onMessageLength),e[0]){case 0:return this._onChoke();case 1:return this._onUnchoke();case 2:return this._onInterested();case 3:return this._onUninterested();case 4:return this._onHave(e.readUInt32BE(1));case 5:return this._onBitField(e.slice(1));case 6:return this._onRequest(e.readUInt32BE(1),e.readUInt32BE(5),e.readUInt32BE(9));case 7:return this._onPiece(e.readUInt32BE(1),e.readUInt32BE(5),e.slice(9));case 8:return this._onCancel(e.readUInt32BE(1),e.readUInt32BE(5),e.readUInt32BE(9));case 9:return this._onPort(e.readUInt16BE(1));case 20:return this._onExtended(e.readUInt8(1),e.slice(2));default:return this._debug("got unknown message"),this.emit("unknownmessage",e)}}_determineHandshakeType(){this._parse(1,(e=>{const t=e.readUInt8(0);19===t?this._parse(t+48,this._onHandshakeBuffer):this._parsePe1(e)}))}_parsePe1(e){this._parse(95,(t=>{this._onPe1(i.concat([e,t])),this._parsePe3()}))}_parsePe2(){this._parse(96,(e=>{for(this._onPe2(e);!this._setGenerators;);this._parsePe4()}))}_parsePe3(){const e=i.from(l.sync(i.from(this._utfToHex("req1")+this._sharedSecret,"hex")),"hex");this._parseUntil(e,512),this._parse(20,(e=>{for(this._onPe3(e);!this._setGenerators;);this._parsePe3Encrypted()}))}_parsePe3Encrypted(){this._parse(14,(e=>{const t=this._decryptHandshake(e.slice(0,8)),i=this._decryptHandshake(e.slice(8,12)),n=this._decryptHandshake(e.slice(12,14)).readUInt16BE(0);this._parse(n,(e=>{e=this._decryptHandshake(e),this._parse(2,(n=>{const r=this._decryptHandshake(n).readUInt16BE(0);this._parse(r,(n=>{n=this._decryptHandshake(n),this._onPe3Encrypted(t,i,e,n);const s=r?n.readUInt8(0):null,a=r?n.slice(1,20):null;19===s&&"BitTorrent protocol"===a.toString()?this._onHandshakeBuffer(n.slice(1)):this._parseHandshake()}))}))}))}))}_parsePe4(){const e=this._decryptHandshake(x);this._parseUntil(e,512),this._parse(6,(e=>{const t=this._decryptHandshake(e.slice(0,4)),i=this._decryptHandshake(e.slice(4,6)).readUInt16BE(0);this._parse(i,(e=>{this._decryptHandshake(e),this._onPe4(t),this._parseHandshake(null)}))}))}_parseHandshake(){this._parse(1,(e=>{const t=e.readUInt8(0);if(19!==t)return this._debug("Error: wire not speaking BitTorrent protocol (%s)",t.toString()),void this.end();this._parse(t+48,this._onHandshakeBuffer)}))}_onHandshakeBuffer(e){const t=e.slice(0,19);if("BitTorrent protocol"!==t.toString())return this._debug("Error: wire not speaking BitTorrent protocol (%s)",t.toString()),void this.end();e=e.slice(19),this._onHandshake(e.slice(8,28),e.slice(28,48),{dht:!!(1&e[7]),extended:!!(16&e[5])}),this._parse(4,this._onMessageLength)}_onFinish(){for(this._finished=!0,this.push(null);this.read(););for(clearInterval(this._keepAliveInterval),this._parse(Number.MAX_VALUE,(()=>{}));this.peerRequests.length;)this.peerRequests.pop();for(;this.requests.length;)this._callback(this.requests.pop(),new Error("wire was closed"),null)}_debug(...e){e[0]=`[${this._debugId}] ${e[0]}`,o(...e)}_pull(e,t,i,r){for(let s=0;s2?"one of ".concat(t," ").concat(e.slice(0,i-1).join(", "),", or ")+e[i-1]:2===i?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}return"of ".concat(t," ").concat(String(e))}r("ERR_INVALID_OPT_VALUE",(function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'}),TypeError),r("ERR_INVALID_ARG_TYPE",(function(e,t,i){var n,r,a,o;if("string"==typeof t&&(r="not ",t.substr(!a||a<0?0:+a,r.length)===r)?(n="must not be",t=t.replace(/^not /,"")):n="must be",function(e,t,i){return(void 0===i||i>e.length)&&(i=e.length),e.substring(i-t.length,i)===t}(e," argument"))o="The ".concat(e," ").concat(n," ").concat(s(t,"type"));else{var c=function(e,t,i){return"number"!=typeof i&&(i=0),!(i+t.length>e.length)&&-1!==e.indexOf(t,i)}(e,".")?"property":"argument";o='The "'.concat(e,'" ').concat(c," ").concat(n," ").concat(s(t,"type"))}return o+=". Received type ".concat(typeof i)}),TypeError),r("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),r("ERR_METHOD_NOT_IMPLEMENTED",(function(e){return"The "+e+" method is not implemented"})),r("ERR_STREAM_PREMATURE_CLOSE","Premature close"),r("ERR_STREAM_DESTROYED",(function(e){return"Cannot call "+e+" after a stream was destroyed"})),r("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),r("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),r("ERR_STREAM_WRITE_AFTER_END","write after end"),r("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),r("ERR_UNKNOWN_ENCODING",(function(e){return"Unknown encoding: "+e}),TypeError),r("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),t.exports.codes=n},{}],30:[function(e,t,i){(function(i){(function(){"use strict";var n=Object.keys||function(e){var t=[];for(var i in e)t.push(i);return t};t.exports=l;var r=e("./_stream_readable"),s=e("./_stream_writable");e("inherits")(l,r);for(var a=n(s.prototype),o=0;o0)if("string"==typeof t||a.objectMode||Object.getPrototypeOf(t)===o.prototype||(t=function(e){return o.from(e)}(t)),n)a.endEmitted?w(e,new x):A(e,a,t,!0);else if(a.ended)w(e,new y);else{if(a.destroyed)return!1;a.reading=!1,a.decoder&&!i?(t=a.decoder.write(t),a.objectMode||0!==t.length?A(e,a,t,!1):B(e,a)):A(e,a,t,!1)}else n||(a.reading=!1,B(e,a));return!a.ended&&(a.lengtht.highWaterMark&&(t.highWaterMark=function(e){return e>=j?e=j:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function T(e){var t=e._readableState;l("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(l("emitReadable",t.flowing),t.emittedReadable=!0,i.nextTick(C,e))}function C(e){var t=e._readableState;l("emitReadable_",t.destroyed,t.length,t.ended),t.destroyed||!t.length&&!t.ended||(e.emit("readable"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,U(e)}function B(e,t){t.readingMore||(t.readingMore=!0,i.nextTick(R,e,t))}function R(e,t){for(;!t.reading&&!t.ended&&(t.length0,t.resumeScheduled&&!t.paused?t.flowing=!0:e.listenerCount("data")>0&&e.resume()}function O(e){l("readable nexttick read 0"),e.read(0)}function P(e,t){l("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),U(e),t.flowing&&!t.reading&&e.read(0)}function U(e){var t=e._readableState;for(l("flow",t.flowing);t.flowing&&null!==e.read(););}function q(e,t){return 0===t.length?null:(t.objectMode?i=t.buffer.shift():!e||e>=t.length?(i=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.first():t.buffer.concat(t.length),t.buffer.clear()):i=t.buffer.consume(e,t.decoder),i);var i}function N(e){var t=e._readableState;l("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,i.nextTick(D,t,e))}function D(e,t){if(l("endReadableNT",e.endEmitted,e.length),!e.endEmitted&&0===e.length&&(e.endEmitted=!0,t.readable=!1,t.emit("end"),e.autoDestroy)){var i=t._writableState;(!i||i.autoDestroy&&i.finished)&&t.destroy()}}function z(e,t){for(var i=0,n=e.length;i=t.highWaterMark:t.length>0)||t.ended))return l("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?N(this):T(this),null;if(0===(e=I(e,t))&&t.ended)return 0===t.length&&N(this),null;var n,r=t.needReadable;return l("need readable",r),(0===t.length||t.length-e0?q(e,t):null)?(t.needReadable=t.length<=t.highWaterMark,e=0):(t.length-=e,t.awaitDrain=0),0===t.length&&(t.ended||(t.needReadable=!0),i!==e&&t.ended&&N(this)),null!==n&&this.emit("data",n),n},S.prototype._read=function(e){w(this,new _("_read()"))},S.prototype.pipe=function(e,t){var n=this,r=this._readableState;switch(r.pipesCount){case 0:r.pipes=e;break;case 1:r.pipes=[r.pipes,e];break;default:r.pipes.push(e)}r.pipesCount+=1,l("pipe count=%d opts=%j",r.pipesCount,t);var a=(!t||!1!==t.end)&&e!==i.stdout&&e!==i.stderr?c:b;function o(t,i){l("onunpipe"),t===n&&i&&!1===i.hasUnpiped&&(i.hasUnpiped=!0,l("cleanup"),e.removeListener("close",h),e.removeListener("finish",m),e.removeListener("drain",u),e.removeListener("error",f),e.removeListener("unpipe",o),n.removeListener("end",c),n.removeListener("end",b),n.removeListener("data",d),p=!0,!r.awaitDrain||e._writableState&&!e._writableState.needDrain||u())}function c(){l("onend"),e.end()}r.endEmitted?i.nextTick(a):n.once("end",a),e.on("unpipe",o);var u=function(e){return function(){var t=e._readableState;l("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&s(e,"data")&&(t.flowing=!0,U(e))}}(n);e.on("drain",u);var p=!1;function d(t){l("ondata");var i=e.write(t);l("dest.write",i),!1===i&&((1===r.pipesCount&&r.pipes===e||r.pipesCount>1&&-1!==z(r.pipes,e))&&!p&&(l("false write response, pause",r.awaitDrain),r.awaitDrain++),n.pause())}function f(t){l("onerror",t),b(),e.removeListener("error",f),0===s(e,"error")&&w(e,t)}function h(){e.removeListener("finish",m),b()}function m(){l("onfinish"),e.removeListener("close",h),b()}function b(){l("unpipe"),n.unpipe(e)}return n.on("data",d),function(e,t,i){if("function"==typeof e.prependListener)return e.prependListener(t,i);e._events&&e._events[t]?Array.isArray(e._events[t])?e._events[t].unshift(i):e._events[t]=[i,e._events[t]]:e.on(t,i)}(e,"error",f),e.once("close",h),e.once("finish",m),e.emit("pipe",n),r.flowing||(l("pipe resume"),n.resume()),e},S.prototype.unpipe=function(e){var t=this._readableState,i={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes||(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,i)),this;if(!e){var n=t.pipes,r=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var s=0;s0,!1!==r.flowing&&this.resume()):"readable"===e&&(r.endEmitted||r.readableListening||(r.readableListening=r.needReadable=!0,r.flowing=!1,r.emittedReadable=!1,l("on readable",r.length,r.reading),r.length?T(this):r.reading||i.nextTick(O,this))),n},S.prototype.addListener=S.prototype.on,S.prototype.removeListener=function(e,t){var n=a.prototype.removeListener.call(this,e,t);return"readable"===e&&i.nextTick(L,this),n},S.prototype.removeAllListeners=function(e){var t=a.prototype.removeAllListeners.apply(this,arguments);return"readable"!==e&&void 0!==e||i.nextTick(L,this),t},S.prototype.resume=function(){var e=this._readableState;return e.flowing||(l("resume"),e.flowing=!e.readableListening,function(e,t){t.resumeScheduled||(t.resumeScheduled=!0,i.nextTick(P,e,t))}(this,e)),e.paused=!1,this},S.prototype.pause=function(){return l("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(l("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},S.prototype.wrap=function(e){var t=this,i=this._readableState,n=!1;for(var r in e.on("end",(function(){if(l("wrapped end"),i.decoder&&!i.ended){var e=i.decoder.end();e&&e.length&&t.push(e)}t.push(null)})),e.on("data",(function(r){(l("wrapped data"),i.decoder&&(r=i.decoder.write(r)),i.objectMode&&null==r)||(i.objectMode||r&&r.length)&&(t.push(r)||(n=!0,e.pause()))})),e)void 0===this[r]&&"function"==typeof e[r]&&(this[r]=function(t){return function(){return e[t].apply(e,arguments)}}(r));for(var s=0;s-1))throw new x(e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(S.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(S.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),S.prototype._write=function(e,t,i){i(new m("_write()"))},S.prototype._writev=null,S.prototype.end=function(e,t,n){var r=this._writableState;return"function"==typeof e?(n=e,e=null,t=null):"function"==typeof t&&(n=t,t=null),null!=e&&this.write(e,t),r.corked&&(r.corked=1,this.uncork()),r.ending||function(e,t,n){t.ending=!0,C(e,t),n&&(t.finished?i.nextTick(n):e.once("finish",n));t.ended=!0,e.writable=!1}(this,r,n),this},Object.defineProperty(S.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(S.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),S.prototype.destroy=p.destroy,S.prototype._undestroy=p.undestroy,S.prototype._destroy=function(e,t){t(e)}}).call(this)}).call(this,e("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../errors":29,"./_stream_duplex":30,"./internal/streams/destroy":37,"./internal/streams/state":41,"./internal/streams/stream":42,_process:341,buffer:110,inherits:246,"util-deprecate":485}],35:[function(e,t,i){(function(i){(function(){"use strict";var n;function r(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}var s=e("./end-of-stream"),a=Symbol("lastResolve"),o=Symbol("lastReject"),c=Symbol("error"),l=Symbol("ended"),u=Symbol("lastPromise"),p=Symbol("handlePromise"),d=Symbol("stream");function f(e,t){return{value:e,done:t}}function h(e){var t=e[a];if(null!==t){var i=e[d].read();null!==i&&(e[u]=null,e[a]=null,e[o]=null,t(f(i,!1)))}}function m(e){i.nextTick(h,e)}var b=Object.getPrototypeOf((function(){})),v=Object.setPrototypeOf((r(n={get stream(){return this[d]},next:function(){var e=this,t=this[c];if(null!==t)return Promise.reject(t);if(this[l])return Promise.resolve(f(void 0,!0));if(this[d].destroyed)return new Promise((function(t,n){i.nextTick((function(){e[c]?n(e[c]):t(f(void 0,!0))}))}));var n,r=this[u];if(r)n=new Promise(function(e,t){return function(i,n){e.then((function(){t[l]?i(f(void 0,!0)):t[p](i,n)}),n)}}(r,this));else{var s=this[d].read();if(null!==s)return Promise.resolve(f(s,!1));n=new Promise(this[p])}return this[u]=n,n}},Symbol.asyncIterator,(function(){return this})),r(n,"return",(function(){var e=this;return new Promise((function(t,i){e[d].destroy(null,(function(e){e?i(e):t(f(void 0,!0))}))}))})),n),b);t.exports=function(e){var t,i=Object.create(v,(r(t={},d,{value:e,writable:!0}),r(t,a,{value:null,writable:!0}),r(t,o,{value:null,writable:!0}),r(t,c,{value:null,writable:!0}),r(t,l,{value:e._readableState.endEmitted,writable:!0}),r(t,p,{value:function(e,t){var n=i[d].read();n?(i[u]=null,i[a]=null,i[o]=null,e(f(n,!1))):(i[a]=e,i[o]=t)},writable:!0}),t));return i[u]=null,s(e,(function(e){if(e&&"ERR_STREAM_PREMATURE_CLOSE"!==e.code){var t=i[o];return null!==t&&(i[u]=null,i[a]=null,i[o]=null,t(e)),void(i[c]=e)}var n=i[a];null!==n&&(i[u]=null,i[a]=null,i[o]=null,n(f(void 0,!0))),i[l]=!0})),e.on("readable",m.bind(null,i)),i}}).call(this)}).call(this,e("_process"))},{"./end-of-stream":38,_process:341}],36:[function(e,t,i){"use strict";function n(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function r(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function s(e,t){for(var i=0;i0?this.tail.next=t:this.head=t,this.tail=t,++this.length}},{key:"unshift",value:function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length}},{key:"shift",value:function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(e){if(0===this.length)return"";for(var t=this.head,i=""+t.data;t=t.next;)i+=e+t.data;return i}},{key:"concat",value:function(e){if(0===this.length)return a.alloc(0);for(var t,i,n,r=a.allocUnsafe(e>>>0),s=this.head,o=0;s;)t=s.data,i=r,n=o,a.prototype.copy.call(t,i,n),o+=s.data.length,s=s.next;return r}},{key:"consume",value:function(e,t){var i;return er.length?r.length:e;if(s===r.length?n+=r:n+=r.slice(0,e),0==(e-=s)){s===r.length?(++i,t.next?this.head=t.next:this.head=this.tail=null):(this.head=t,t.data=r.slice(s));break}++i}return this.length-=i,n}},{key:"_getBuffer",value:function(e){var t=a.allocUnsafe(e),i=this.head,n=1;for(i.data.copy(t),e-=i.data.length;i=i.next;){var r=i.data,s=e>r.length?r.length:e;if(r.copy(t,t.length-e,0,s),0==(e-=s)){s===r.length?(++n,i.next?this.head=i.next:this.head=this.tail=null):(this.head=i,i.data=r.slice(s));break}++n}return this.length-=n,t}},{key:c,value:function(e,t){return o(this,function(e){for(var t=1;t0,(function(e){n||(n=e),e&&a.forEach(l),s||(a.forEach(l),r(n))}))}));return t.reduce(u)}},{"../../../errors":29,"./end-of-stream":38}],41:[function(e,t,i){"use strict";var n=e("../../../errors").codes.ERR_INVALID_OPT_VALUE;t.exports={getHighWaterMark:function(e,t,i,r){var s=function(e,t,i){return null!=e.highWaterMark?e.highWaterMark:t?e[i]:null}(t,r,i);if(null!=s){if(!isFinite(s)||Math.floor(s)!==s||s<0)throw new n(r?i:"highWaterMark",s);return Math.floor(s)}return e.objectMode?16:16384}}},{"../../../errors":29}],42:[function(e,t,i){t.exports=e("events").EventEmitter},{events:193}],43:[function(e,t,i){(i=t.exports=e("./lib/_stream_readable.js")).Stream=i,i.Readable=i,i.Writable=e("./lib/_stream_writable.js"),i.Duplex=e("./lib/_stream_duplex.js"),i.Transform=e("./lib/_stream_transform.js"),i.PassThrough=e("./lib/_stream_passthrough.js"),i.finished=e("./lib/internal/streams/end-of-stream.js"),i.pipeline=e("./lib/internal/streams/pipeline.js")},{"./lib/_stream_duplex.js":30,"./lib/_stream_passthrough.js":31,"./lib/_stream_readable.js":32,"./lib/_stream_transform.js":33,"./lib/_stream_writable.js":34,"./lib/internal/streams/end-of-stream.js":38,"./lib/internal/streams/pipeline.js":40}],44:[function(e,t,i){(function(i,n){(function(){const r=e("debug")("bittorrent-tracker:client"),s=e("events"),a=e("once"),o=e("run-parallel"),c=e("simple-peer"),l=e("queue-microtask"),u=e("./lib/common"),p=e("./lib/client/http-tracker"),d=e("./lib/client/udp-tracker"),f=e("./lib/client/websocket-tracker");class h extends s{constructor(e={}){if(super(),!e.peerId)throw new Error("Option `peerId` is required");if(!e.infoHash)throw new Error("Option `infoHash` is required");if(!e.announce)throw new Error("Option `announce` is required");if(!i.browser&&!e.port)throw new Error("Option `port` is required");this.peerId="string"==typeof e.peerId?e.peerId:e.peerId.toString("hex"),this._peerIdBuffer=n.from(this.peerId,"hex"),this._peerIdBinary=this._peerIdBuffer.toString("binary"),this.infoHash="string"==typeof e.infoHash?e.infoHash.toLowerCase():e.infoHash.toString("hex"),this._infoHashBuffer=n.from(this.infoHash,"hex"),this._infoHashBinary=this._infoHashBuffer.toString("binary"),r("new client %s",this.infoHash),this.destroyed=!1,this._port=e.port,this._getAnnounceOpts=e.getAnnounceOpts,this._rtcConfig=e.rtcConfig,this._userAgent=e.userAgent,this._proxyOpts=e.proxyOpts,this._wrtc="function"==typeof e.wrtc?e.wrtc():e.wrtc;let t="string"==typeof e.announce?[e.announce]:null==e.announce?[]:e.announce;t=t.map((e=>("/"===(e=e.toString())[e.length-1]&&(e=e.substring(0,e.length-1)),e))),t=Array.from(new Set(t));const s=!1!==this._wrtc&&(!!this._wrtc||c.WEBRTC_SUPPORT),a=e=>{l((()=>{this.emit("warning",e)}))};this._trackers=t.map((e=>{let t;try{t=u.parseUrl(e)}catch(t){return a(new Error(`Invalid tracker URL: ${e}`)),null}const i=t.port;if(i<0||i>65535)return a(new Error(`Invalid tracker port: ${e}`)),null;const n=t.protocol;return"http:"!==n&&"https:"!==n||"function"!=typeof p?"udp:"===n&&"function"==typeof d?new d(this,e):"ws:"!==n&&"wss:"!==n||!s||"ws:"===n&&"undefined"!=typeof window&&"https:"===window.location.protocol?(a(new Error(`Unsupported tracker protocol: ${e}`)),null):new f(this,e):new p(this,e)})).filter(Boolean)}start(e){(e=this._defaultAnnounceOpts(e)).event="started",r("send `start` %o",e),this._announce(e),this._trackers.forEach((e=>{e.setInterval()}))}stop(e){(e=this._defaultAnnounceOpts(e)).event="stopped",r("send `stop` %o",e),this._announce(e)}complete(e){e||(e={}),(e=this._defaultAnnounceOpts(e)).event="completed",r("send `complete` %o",e),this._announce(e)}update(e){(e=this._defaultAnnounceOpts(e)).event&&delete e.event,r("send `update` %o",e),this._announce(e)}_announce(e){this._trackers.forEach((t=>{t.announce(e)}))}scrape(e){r("send `scrape`"),e||(e={}),this._trackers.forEach((t=>{t.scrape(e)}))}setInterval(e){r("setInterval %d",e),this._trackers.forEach((t=>{t.setInterval(e)}))}destroy(e){if(this.destroyed)return;this.destroyed=!0,r("destroy");const t=this._trackers.map((e=>t=>{e.destroy(t)}));o(t,e),this._trackers=[],this._getAnnounceOpts=null}_defaultAnnounceOpts(e={}){return null==e.numwant&&(e.numwant=u.DEFAULT_ANNOUNCE_PEERS),null==e.uploaded&&(e.uploaded=0),null==e.downloaded&&(e.downloaded=0),this._getAnnounceOpts&&(e=Object.assign({},e,this._getAnnounceOpts())),e}}h.scrape=(e,t)=>{if(t=a(t),!e.infoHash)throw new Error("Option `infoHash` is required");if(!e.announce)throw new Error("Option `announce` is required");const i=Object.assign({},e,{infoHash:Array.isArray(e.infoHash)?e.infoHash[0]:e.infoHash,peerId:n.from("01234567890123456789"),port:6881}),r=new h(i);r.once("error",t),r.once("warning",t);let s=Array.isArray(e.infoHash)?e.infoHash.length:1;const o={};return r.on("scrape",(e=>{if(s-=1,o[e.infoHash]=e,0===s){r.destroy();const e=Object.keys(o);1===e.length?t(null,o[e[0]]):t(null,o)}})),e.infoHash=Array.isArray(e.infoHash)?e.infoHash.map((e=>n.from(e,"hex"))):n.from(e.infoHash,"hex"),r.scrape({infoHash:e.infoHash}),r},t.exports=h}).call(this)}).call(this,e("_process"),e("buffer").Buffer)},{"./lib/client/http-tracker":67,"./lib/client/udp-tracker":67,"./lib/client/websocket-tracker":46,"./lib/common":47,_process:341,buffer:110,debug:161,events:193,once:326,"queue-microtask":354,"run-parallel":381,"simple-peer":395}],45:[function(e,t,i){const n=e("events");t.exports=class extends n{constructor(e,t){super(),this.client=e,this.announceUrl=t,this.interval=null,this.destroyed=!1}setInterval(e){null==e&&(e=this.DEFAULT_ANNOUNCE_INTERVAL),clearInterval(this.interval),e&&(this.interval=setInterval((()=>{this.announce(this.client._defaultAnnounceOpts())}),e),this.interval.unref&&this.interval.unref())}}},{events:193}],46:[function(e,t,i){const n=e("clone"),r=e("debug")("bittorrent-tracker:websocket-tracker"),s=e("simple-peer"),a=e("randombytes"),o=e("simple-websocket"),c=e("socks"),l=e("../common"),u=e("./tracker"),p={};class d extends u{constructor(e,t){super(e,t),r("new websocket tracker %s",t),this.peers={},this.socket=null,this.reconnecting=!1,this.retries=0,this.reconnectTimer=null,this.expectingResponse=!1,this._openSocket()}announce(e){if(this.destroyed||this.reconnecting)return;if(!this.socket.connected)return void this.socket.once("connect",(()=>{this.announce(e)}));const t=Object.assign({},e,{action:"announce",info_hash:this.client._infoHashBinary,peer_id:this.client._peerIdBinary});if(this._trackerId&&(t.trackerid=this._trackerId),"stopped"===e.event||"completed"===e.event)this._send(t);else{const i=Math.min(e.numwant,5);this._generateOffers(i,(e=>{t.numwant=i,t.offers=e,this._send(t)}))}}scrape(e){if(this.destroyed||this.reconnecting)return;if(!this.socket.connected)return void this.socket.once("connect",(()=>{this.scrape(e)}));const t={action:"scrape",info_hash:Array.isArray(e.infoHash)&&e.infoHash.length>0?e.infoHash.map((e=>e.toString("binary"))):e.infoHash&&e.infoHash.toString("binary")||this.client._infoHashBinary};this._send(t)}destroy(e=f){if(this.destroyed)return e(null);this.destroyed=!0,clearInterval(this.interval),clearTimeout(this.reconnectTimer);for(const e in this.peers){const t=this.peers[e];clearTimeout(t.trackerTimeout),t.destroy()}if(this.peers=null,this.socket&&(this.socket.removeListener("connect",this._onSocketConnectBound),this.socket.removeListener("data",this._onSocketDataBound),this.socket.removeListener("close",this._onSocketCloseBound),this.socket.removeListener("error",this._onSocketErrorBound),this.socket=null),this._onSocketConnectBound=null,this._onSocketErrorBound=null,this._onSocketDataBound=null,this._onSocketCloseBound=null,p[this.announceUrl]&&(p[this.announceUrl].consumers-=1),p[this.announceUrl].consumers>0)return e();let t,i=p[this.announceUrl];if(delete p[this.announceUrl],i.on("error",f),i.once("close",e),!this.expectingResponse)return n();function n(){t&&(clearTimeout(t),t=null),i.removeListener("data",n),i.destroy(),i=null}t=setTimeout(n,l.DESTROY_TIMEOUT),i.once("data",n)}_openSocket(){if(this.destroyed=!1,this.peers||(this.peers={}),this._onSocketConnectBound=()=>{this._onSocketConnect()},this._onSocketErrorBound=e=>{this._onSocketError(e)},this._onSocketDataBound=e=>{this._onSocketData(e)},this._onSocketCloseBound=()=>{this._onSocketClose()},this.socket=p[this.announceUrl],this.socket)p[this.announceUrl].consumers+=1,this.socket.connected&&this._onSocketConnectBound();else{const e=new URL(this.announceUrl);let t;this.client._proxyOpts&&(t="wss:"===e.protocol?this.client._proxyOpts.httpsAgent:this.client._proxyOpts.httpAgent,!t&&this.client._proxyOpts.socksProxy&&(t=new c.Agent(n(this.client._proxyOpts.socksProxy),"wss:"===e.protocol))),this.socket=p[this.announceUrl]=new o({url:this.announceUrl,agent:t}),this.socket.consumers=1,this.socket.once("connect",this._onSocketConnectBound)}this.socket.on("data",this._onSocketDataBound),this.socket.once("close",this._onSocketCloseBound),this.socket.once("error",this._onSocketErrorBound)}_onSocketConnect(){this.destroyed||this.reconnecting&&(this.reconnecting=!1,this.retries=0,this.announce(this.client._defaultAnnounceOpts()))}_onSocketData(e){if(!this.destroyed){this.expectingResponse=!1;try{e=JSON.parse(e)}catch(e){return void this.client.emit("warning",new Error("Invalid tracker response"))}"announce"===e.action?this._onAnnounceResponse(e):"scrape"===e.action?this._onScrapeResponse(e):this._onSocketError(new Error(`invalid action in WS response: ${e.action}`))}}_onAnnounceResponse(e){if(e.info_hash!==this.client._infoHashBinary)return void r("ignoring websocket data from %s for %s (looking for %s: reused socket)",this.announceUrl,l.binaryToHex(e.info_hash),this.client.infoHash);if(e.peer_id&&e.peer_id===this.client._peerIdBinary)return;r("received %s from %s for %s",JSON.stringify(e),this.announceUrl,this.client.infoHash);const t=e["failure reason"];if(t)return this.client.emit("warning",new Error(t));const i=e["warning message"];i&&this.client.emit("warning",new Error(i));const n=e.interval||e["min interval"];n&&this.setInterval(1e3*n);const s=e["tracker id"];if(s&&(this._trackerId=s),null!=e.complete){const t=Object.assign({},e,{announce:this.announceUrl,infoHash:l.binaryToHex(e.info_hash)});this.client.emit("update",t)}let a;if(e.offer&&e.peer_id&&(r("creating peer (from remote offer)"),a=this._createPeer(),a.id=l.binaryToHex(e.peer_id),a.once("signal",(t=>{const i={action:"announce",info_hash:this.client._infoHashBinary,peer_id:this.client._peerIdBinary,to_peer_id:e.peer_id,answer:t,offer_id:e.offer_id};this._trackerId&&(i.trackerid=this._trackerId),this._send(i)})),this.client.emit("peer",a),a.signal(e.offer)),e.answer&&e.peer_id){const t=l.binaryToHex(e.offer_id);a=this.peers[t],a?(a.id=l.binaryToHex(e.peer_id),this.client.emit("peer",a),a.signal(e.answer),clearTimeout(a.trackerTimeout),a.trackerTimeout=null,delete this.peers[t]):r(`got unexpected answer: ${JSON.stringify(e.answer)}`)}}_onScrapeResponse(e){e=e.files||{};const t=Object.keys(e);0!==t.length?t.forEach((t=>{const i=Object.assign(e[t],{announce:this.announceUrl,infoHash:l.binaryToHex(t)});this.client.emit("scrape",i)})):this.client.emit("warning",new Error("invalid scrape response"))}_onSocketClose(){this.destroyed||(this.destroy(),this._startReconnectTimer())}_onSocketError(e){this.destroyed||(this.destroy(),this.client.emit("warning",e),this._startReconnectTimer())}_startReconnectTimer(){const e=Math.floor(3e5*Math.random())+Math.min(1e4*Math.pow(2,this.retries),36e5);this.reconnecting=!0,clearTimeout(this.reconnectTimer),this.reconnectTimer=setTimeout((()=>{this.retries++,this._openSocket()}),e),this.reconnectTimer.unref&&this.reconnectTimer.unref(),r("reconnecting socket in %s ms",e)}_send(e){if(this.destroyed)return;this.expectingResponse=!0;const t=JSON.stringify(e);r("send %s",t),this.socket.send(t)}_generateOffers(e,t){const i=this,n=[];r("generating %s offers",e);for(let t=0;t{n.push({offer:t,offer_id:l.hexToBinary(e)}),o()})),t.trackerTimeout=setTimeout((()=>{r("tracker timeout: destroying peer"),t.trackerTimeout=null,delete i.peers[e],t.destroy()}),5e4),t.trackerTimeout.unref&&t.trackerTimeout.unref()}function o(){n.length===e&&(r("generated %s offers",e),t(n))}o()}_createPeer(e){const t=this;e=Object.assign({trickle:!1,config:t.client._rtcConfig,wrtc:t.client._wrtc},e);const i=new s(e);return i.once("error",n),i.once("connect",(function e(){i.removeListener("error",n),i.removeListener("connect",e)})),i;function n(e){t.client.emit("warning",new Error(`Connection error: ${e.message}`)),i.destroy()}}}function f(){}d.prototype.DEFAULT_ANNOUNCE_INTERVAL=3e4,d._socketPool=p,t.exports=d},{"../common":47,"./tracker":45,clone:136,debug:161,randombytes:357,"simple-peer":395,"simple-websocket":413,socks:67}],47:[function(e,t,i){(function(t){(function(){i.DEFAULT_ANNOUNCE_PEERS=50,i.MAX_ANNOUNCE_PEERS=82,i.binaryToHex=e=>("string"!=typeof e&&(e=String(e)),t.from(e,"binary").toString("hex")),i.hexToBinary=e=>("string"!=typeof e&&(e=String(e)),t.from(e,"hex").toString("binary")),i.parseUrl=e=>{const t=new URL(e.replace(/^udp:/,"http:"));return e.match(/^udp:/)&&Object.defineProperties(t,{href:{value:t.href.replace(/^http/,"udp")},protocol:{value:t.protocol.replace(/^http/,"udp")},origin:{value:t.origin.replace(/^http/,"udp")}}),t};const n=e("./common-node");Object.assign(i,n)}).call(this)}).call(this,e("buffer").Buffer)},{"./common-node":67,buffer:110}],48:[function(e,t,i){(function(e){(function(){ /*! blob-to-buffer. MIT License. Feross Aboukhadijeh */ -t.exports=function(t,n){if("undefined"==typeof Blob||!(t instanceof Blob))throw new Error("first argument must be a Blob");if("function"!=typeof n)throw new Error("second argument must be a function");const i=new FileReader;i.addEventListener("loadend",(function t(r){i.removeEventListener("loadend",t,!1),r.error?n(r.error):n(null,e.from(i.result))}),!1),i.readAsArrayBuffer(t)}}).call(this)}).call(this,e("buffer").Buffer)},{buffer:116}],55:[function(e,t,n){(function(n){(function(){const{Transform:i}=e("readable-stream");t.exports=class extends i{constructor(e,t={}){super(t),"object"==typeof e&&(e=(t=e).size),this.size=e||512;const{nopad:n,zeroPadding:i=!0}=t;this._zeroPadding=!n&&!!i,this._buffered=[],this._bufferedBytes=0}_transform(e,t,i){for(this._bufferedBytes+=e.length,this._buffered.push(e);this._bufferedBytes>=this.size;){this._bufferedBytes-=this.size;const e=[];let t=0;for(;t=48&&n<=57?n-48:n>=65&&n<=70?n-55:n>=97&&n<=102?n-87:void i(!1,"Invalid character in "+e)}function c(e,t,n){var i=a(e,n);return n-1>=t&&(i|=a(e,n-1)<<4),i}function u(e,t,n,r){for(var s=0,o=0,a=Math.min(e.length,n),c=t;c=49?u-49+10:u>=17?u-17+10:u,i(u>=0&&o0?e:t},s.min=function(e,t){return e.cmp(t)<0?e:t},s.prototype._init=function(e,t,n){if("number"==typeof e)return this._initNumber(e,t,n);if("object"==typeof e)return this._initArray(e,t,n);"hex"===t&&(t=16),i(t===(0|t)&&t>=2&&t<=36);var r=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(r++,this.negative=1),r=0;r-=3)o=e[r]|e[r-1]<<8|e[r-2]<<16,this.words[s]|=o<>>26-a&67108863,(a+=24)>=26&&(a-=26,s++);else if("le"===n)for(r=0,s=0;r>>26-a&67108863,(a+=24)>=26&&(a-=26,s++);return this._strip()},s.prototype._parseHex=function(e,t,n){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var i=0;i=t;i-=2)r=c(e,t,i)<=18?(s-=18,o+=1,this.words[o]|=r>>>26):s+=8;else for(i=(e.length-t)%2==0?t+1:t;i=18?(s-=18,o+=1,this.words[o]|=r>>>26):s+=8;this._strip()},s.prototype._parseBase=function(e,t,n){this.words=[0],this.length=1;for(var i=0,r=1;r<=67108863;r*=t)i++;i--,r=r/t|0;for(var s=e.length-n,o=s%i,a=Math.min(s,s-o)+n,c=0,l=n;l1&&0===this.words[this.length-1];)this.length--;return this._normSign()},s.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"undefined"!=typeof Symbol&&"function"==typeof Symbol.for)try{s.prototype[Symbol.for("nodejs.util.inspect.custom")]=d}catch(e){s.prototype.inspect=d}else s.prototype.inspect=d;function d(){return(this.red?""}var f=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],p=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],h=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];s.prototype.toString=function(e,t){var n;if(t=0|t||1,16===(e=e||10)||"hex"===e){n="";for(var r=0,s=0,o=0;o>>24-r&16777215)||o!==this.length-1?f[6-c.length]+c+n:c+n,(r+=2)>=26&&(r-=26,o--)}for(0!==s&&(n=s.toString(16)+n);n.length%t!=0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}if(e===(0|e)&&e>=2&&e<=36){var u=p[e],l=h[e];n="";var d=this.clone();for(d.negative=0;!d.isZero();){var m=d.modrn(l).toString(e);n=(d=d.idivn(l)).isZero()?m+n:f[u-m.length]+m+n}for(this.isZero()&&(n="0"+n);n.length%t!=0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}i(!1,"Base should be between 2 and 36")},s.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&i(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},s.prototype.toJSON=function(){return this.toString(16,2)},o&&(s.prototype.toBuffer=function(e,t){return this.toArrayLike(o,e,t)}),s.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)};function m(e,t,n){n.negative=t.negative^e.negative;var i=e.length+t.length|0;n.length=i,i=i-1|0;var r=0|e.words[0],s=0|t.words[0],o=r*s,a=67108863&o,c=o/67108864|0;n.words[0]=a;for(var u=1;u>>26,d=67108863&c,f=Math.min(u,t.length-1),p=Math.max(0,u-e.length+1);p<=f;p++){var h=u-p|0;l+=(o=(r=0|e.words[h])*(s=0|t.words[p])+d)/67108864|0,d=67108863&o}n.words[u]=0|d,c=0|l}return 0!==c?n.words[u]=0|c:n.length--,n._strip()}s.prototype.toArrayLike=function(e,t,n){this._strip();var r=this.byteLength(),s=n||Math.max(1,r);i(r<=s,"byte array longer than desired length"),i(s>0,"Requested array length <= 0");var o=function(e,t){return e.allocUnsafe?e.allocUnsafe(t):new e(t)}(e,s);return this["_toArrayLike"+("le"===t?"LE":"BE")](o,r),o},s.prototype._toArrayLikeLE=function(e,t){for(var n=0,i=0,r=0,s=0;r>8&255),n>16&255),6===s?(n>24&255),i=0,s=0):(i=o>>>24,s+=2)}if(n=0&&(e[n--]=o>>8&255),n>=0&&(e[n--]=o>>16&255),6===s?(n>=0&&(e[n--]=o>>24&255),i=0,s=0):(i=o>>>24,s+=2)}if(n>=0)for(e[n--]=i;n>=0;)e[n--]=0},Math.clz32?s.prototype._countBits=function(e){return 32-Math.clz32(e)}:s.prototype._countBits=function(e){var t=e,n=0;return t>=4096&&(n+=13,t>>>=13),t>=64&&(n+=7,t>>>=7),t>=8&&(n+=4,t>>>=4),t>=2&&(n+=2,t>>>=2),n+t},s.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,n=0;return 0==(8191&t)&&(n+=13,t>>>=13),0==(127&t)&&(n+=7,t>>>=7),0==(15&t)&&(n+=4,t>>>=4),0==(3&t)&&(n+=2,t>>>=2),0==(1&t)&&n++,n},s.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},s.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},s.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},s.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var n=0;ne.length?this.clone().iand(e):e.clone().iand(this)},s.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},s.prototype.iuxor=function(e){var t,n;this.length>e.length?(t=this,n=e):(t=e,n=this);for(var i=0;ie.length?this.clone().ixor(e):e.clone().ixor(this)},s.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},s.prototype.inotn=function(e){i("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),n=e%26;this._expand(t),n>0&&t--;for(var r=0;r0&&(this.words[r]=~this.words[r]&67108863>>26-n),this._strip()},s.prototype.notn=function(e){return this.clone().inotn(e)},s.prototype.setn=function(e,t){i("number"==typeof e&&e>=0);var n=e/26|0,r=e%26;return this._expand(n+1),this.words[n]=t?this.words[n]|1<e.length?(n=this,i=e):(n=e,i=this);for(var r=0,s=0;s>>26;for(;0!==r&&s>>26;if(this.length=n.length,0!==r)this.words[this.length]=r,this.length++;else if(n!==this)for(;se.length?this.clone().iadd(e):e.clone().iadd(this)},s.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var n,i,r=this.cmp(e);if(0===r)return this.negative=0,this.length=1,this.words[0]=0,this;r>0?(n=this,i=e):(n=e,i=this);for(var s=0,o=0;o>26,this.words[o]=67108863&t;for(;0!==s&&o>26,this.words[o]=67108863&t;if(0===s&&o>>13,p=0|o[1],h=8191&p,m=p>>>13,b=0|o[2],g=8191&b,v=b>>>13,y=0|o[3],_=8191&y,w=y>>>13,x=0|o[4],k=8191&x,E=x>>>13,S=0|o[5],M=8191&S,A=S>>>13,I=0|o[6],T=8191&I,j=I>>>13,C=0|o[7],B=8191&C,R=C>>>13,L=0|o[8],O=8191&L,P=L>>>13,U=0|o[9],q=8191&U,N=U>>>13,D=0|a[0],z=8191&D,H=D>>>13,F=0|a[1],W=8191&F,V=F>>>13,K=0|a[2],$=8191&K,G=K>>>13,X=0|a[3],Y=8191&X,Z=X>>>13,J=0|a[4],Q=8191&J,ee=J>>>13,te=0|a[5],ne=8191&te,ie=te>>>13,re=0|a[6],se=8191&re,oe=re>>>13,ae=0|a[7],ce=8191&ae,ue=ae>>>13,le=0|a[8],de=8191&le,fe=le>>>13,pe=0|a[9],he=8191&pe,me=pe>>>13;n.negative=e.negative^t.negative,n.length=19;var be=(u+(i=Math.imul(d,z))|0)+((8191&(r=(r=Math.imul(d,H))+Math.imul(f,z)|0))<<13)|0;u=((s=Math.imul(f,H))+(r>>>13)|0)+(be>>>26)|0,be&=67108863,i=Math.imul(h,z),r=(r=Math.imul(h,H))+Math.imul(m,z)|0,s=Math.imul(m,H);var ge=(u+(i=i+Math.imul(d,W)|0)|0)+((8191&(r=(r=r+Math.imul(d,V)|0)+Math.imul(f,W)|0))<<13)|0;u=((s=s+Math.imul(f,V)|0)+(r>>>13)|0)+(ge>>>26)|0,ge&=67108863,i=Math.imul(g,z),r=(r=Math.imul(g,H))+Math.imul(v,z)|0,s=Math.imul(v,H),i=i+Math.imul(h,W)|0,r=(r=r+Math.imul(h,V)|0)+Math.imul(m,W)|0,s=s+Math.imul(m,V)|0;var ve=(u+(i=i+Math.imul(d,$)|0)|0)+((8191&(r=(r=r+Math.imul(d,G)|0)+Math.imul(f,$)|0))<<13)|0;u=((s=s+Math.imul(f,G)|0)+(r>>>13)|0)+(ve>>>26)|0,ve&=67108863,i=Math.imul(_,z),r=(r=Math.imul(_,H))+Math.imul(w,z)|0,s=Math.imul(w,H),i=i+Math.imul(g,W)|0,r=(r=r+Math.imul(g,V)|0)+Math.imul(v,W)|0,s=s+Math.imul(v,V)|0,i=i+Math.imul(h,$)|0,r=(r=r+Math.imul(h,G)|0)+Math.imul(m,$)|0,s=s+Math.imul(m,G)|0;var ye=(u+(i=i+Math.imul(d,Y)|0)|0)+((8191&(r=(r=r+Math.imul(d,Z)|0)+Math.imul(f,Y)|0))<<13)|0;u=((s=s+Math.imul(f,Z)|0)+(r>>>13)|0)+(ye>>>26)|0,ye&=67108863,i=Math.imul(k,z),r=(r=Math.imul(k,H))+Math.imul(E,z)|0,s=Math.imul(E,H),i=i+Math.imul(_,W)|0,r=(r=r+Math.imul(_,V)|0)+Math.imul(w,W)|0,s=s+Math.imul(w,V)|0,i=i+Math.imul(g,$)|0,r=(r=r+Math.imul(g,G)|0)+Math.imul(v,$)|0,s=s+Math.imul(v,G)|0,i=i+Math.imul(h,Y)|0,r=(r=r+Math.imul(h,Z)|0)+Math.imul(m,Y)|0,s=s+Math.imul(m,Z)|0;var _e=(u+(i=i+Math.imul(d,Q)|0)|0)+((8191&(r=(r=r+Math.imul(d,ee)|0)+Math.imul(f,Q)|0))<<13)|0;u=((s=s+Math.imul(f,ee)|0)+(r>>>13)|0)+(_e>>>26)|0,_e&=67108863,i=Math.imul(M,z),r=(r=Math.imul(M,H))+Math.imul(A,z)|0,s=Math.imul(A,H),i=i+Math.imul(k,W)|0,r=(r=r+Math.imul(k,V)|0)+Math.imul(E,W)|0,s=s+Math.imul(E,V)|0,i=i+Math.imul(_,$)|0,r=(r=r+Math.imul(_,G)|0)+Math.imul(w,$)|0,s=s+Math.imul(w,G)|0,i=i+Math.imul(g,Y)|0,r=(r=r+Math.imul(g,Z)|0)+Math.imul(v,Y)|0,s=s+Math.imul(v,Z)|0,i=i+Math.imul(h,Q)|0,r=(r=r+Math.imul(h,ee)|0)+Math.imul(m,Q)|0,s=s+Math.imul(m,ee)|0;var we=(u+(i=i+Math.imul(d,ne)|0)|0)+((8191&(r=(r=r+Math.imul(d,ie)|0)+Math.imul(f,ne)|0))<<13)|0;u=((s=s+Math.imul(f,ie)|0)+(r>>>13)|0)+(we>>>26)|0,we&=67108863,i=Math.imul(T,z),r=(r=Math.imul(T,H))+Math.imul(j,z)|0,s=Math.imul(j,H),i=i+Math.imul(M,W)|0,r=(r=r+Math.imul(M,V)|0)+Math.imul(A,W)|0,s=s+Math.imul(A,V)|0,i=i+Math.imul(k,$)|0,r=(r=r+Math.imul(k,G)|0)+Math.imul(E,$)|0,s=s+Math.imul(E,G)|0,i=i+Math.imul(_,Y)|0,r=(r=r+Math.imul(_,Z)|0)+Math.imul(w,Y)|0,s=s+Math.imul(w,Z)|0,i=i+Math.imul(g,Q)|0,r=(r=r+Math.imul(g,ee)|0)+Math.imul(v,Q)|0,s=s+Math.imul(v,ee)|0,i=i+Math.imul(h,ne)|0,r=(r=r+Math.imul(h,ie)|0)+Math.imul(m,ne)|0,s=s+Math.imul(m,ie)|0;var xe=(u+(i=i+Math.imul(d,se)|0)|0)+((8191&(r=(r=r+Math.imul(d,oe)|0)+Math.imul(f,se)|0))<<13)|0;u=((s=s+Math.imul(f,oe)|0)+(r>>>13)|0)+(xe>>>26)|0,xe&=67108863,i=Math.imul(B,z),r=(r=Math.imul(B,H))+Math.imul(R,z)|0,s=Math.imul(R,H),i=i+Math.imul(T,W)|0,r=(r=r+Math.imul(T,V)|0)+Math.imul(j,W)|0,s=s+Math.imul(j,V)|0,i=i+Math.imul(M,$)|0,r=(r=r+Math.imul(M,G)|0)+Math.imul(A,$)|0,s=s+Math.imul(A,G)|0,i=i+Math.imul(k,Y)|0,r=(r=r+Math.imul(k,Z)|0)+Math.imul(E,Y)|0,s=s+Math.imul(E,Z)|0,i=i+Math.imul(_,Q)|0,r=(r=r+Math.imul(_,ee)|0)+Math.imul(w,Q)|0,s=s+Math.imul(w,ee)|0,i=i+Math.imul(g,ne)|0,r=(r=r+Math.imul(g,ie)|0)+Math.imul(v,ne)|0,s=s+Math.imul(v,ie)|0,i=i+Math.imul(h,se)|0,r=(r=r+Math.imul(h,oe)|0)+Math.imul(m,se)|0,s=s+Math.imul(m,oe)|0;var ke=(u+(i=i+Math.imul(d,ce)|0)|0)+((8191&(r=(r=r+Math.imul(d,ue)|0)+Math.imul(f,ce)|0))<<13)|0;u=((s=s+Math.imul(f,ue)|0)+(r>>>13)|0)+(ke>>>26)|0,ke&=67108863,i=Math.imul(O,z),r=(r=Math.imul(O,H))+Math.imul(P,z)|0,s=Math.imul(P,H),i=i+Math.imul(B,W)|0,r=(r=r+Math.imul(B,V)|0)+Math.imul(R,W)|0,s=s+Math.imul(R,V)|0,i=i+Math.imul(T,$)|0,r=(r=r+Math.imul(T,G)|0)+Math.imul(j,$)|0,s=s+Math.imul(j,G)|0,i=i+Math.imul(M,Y)|0,r=(r=r+Math.imul(M,Z)|0)+Math.imul(A,Y)|0,s=s+Math.imul(A,Z)|0,i=i+Math.imul(k,Q)|0,r=(r=r+Math.imul(k,ee)|0)+Math.imul(E,Q)|0,s=s+Math.imul(E,ee)|0,i=i+Math.imul(_,ne)|0,r=(r=r+Math.imul(_,ie)|0)+Math.imul(w,ne)|0,s=s+Math.imul(w,ie)|0,i=i+Math.imul(g,se)|0,r=(r=r+Math.imul(g,oe)|0)+Math.imul(v,se)|0,s=s+Math.imul(v,oe)|0,i=i+Math.imul(h,ce)|0,r=(r=r+Math.imul(h,ue)|0)+Math.imul(m,ce)|0,s=s+Math.imul(m,ue)|0;var Ee=(u+(i=i+Math.imul(d,de)|0)|0)+((8191&(r=(r=r+Math.imul(d,fe)|0)+Math.imul(f,de)|0))<<13)|0;u=((s=s+Math.imul(f,fe)|0)+(r>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,i=Math.imul(q,z),r=(r=Math.imul(q,H))+Math.imul(N,z)|0,s=Math.imul(N,H),i=i+Math.imul(O,W)|0,r=(r=r+Math.imul(O,V)|0)+Math.imul(P,W)|0,s=s+Math.imul(P,V)|0,i=i+Math.imul(B,$)|0,r=(r=r+Math.imul(B,G)|0)+Math.imul(R,$)|0,s=s+Math.imul(R,G)|0,i=i+Math.imul(T,Y)|0,r=(r=r+Math.imul(T,Z)|0)+Math.imul(j,Y)|0,s=s+Math.imul(j,Z)|0,i=i+Math.imul(M,Q)|0,r=(r=r+Math.imul(M,ee)|0)+Math.imul(A,Q)|0,s=s+Math.imul(A,ee)|0,i=i+Math.imul(k,ne)|0,r=(r=r+Math.imul(k,ie)|0)+Math.imul(E,ne)|0,s=s+Math.imul(E,ie)|0,i=i+Math.imul(_,se)|0,r=(r=r+Math.imul(_,oe)|0)+Math.imul(w,se)|0,s=s+Math.imul(w,oe)|0,i=i+Math.imul(g,ce)|0,r=(r=r+Math.imul(g,ue)|0)+Math.imul(v,ce)|0,s=s+Math.imul(v,ue)|0,i=i+Math.imul(h,de)|0,r=(r=r+Math.imul(h,fe)|0)+Math.imul(m,de)|0,s=s+Math.imul(m,fe)|0;var Se=(u+(i=i+Math.imul(d,he)|0)|0)+((8191&(r=(r=r+Math.imul(d,me)|0)+Math.imul(f,he)|0))<<13)|0;u=((s=s+Math.imul(f,me)|0)+(r>>>13)|0)+(Se>>>26)|0,Se&=67108863,i=Math.imul(q,W),r=(r=Math.imul(q,V))+Math.imul(N,W)|0,s=Math.imul(N,V),i=i+Math.imul(O,$)|0,r=(r=r+Math.imul(O,G)|0)+Math.imul(P,$)|0,s=s+Math.imul(P,G)|0,i=i+Math.imul(B,Y)|0,r=(r=r+Math.imul(B,Z)|0)+Math.imul(R,Y)|0,s=s+Math.imul(R,Z)|0,i=i+Math.imul(T,Q)|0,r=(r=r+Math.imul(T,ee)|0)+Math.imul(j,Q)|0,s=s+Math.imul(j,ee)|0,i=i+Math.imul(M,ne)|0,r=(r=r+Math.imul(M,ie)|0)+Math.imul(A,ne)|0,s=s+Math.imul(A,ie)|0,i=i+Math.imul(k,se)|0,r=(r=r+Math.imul(k,oe)|0)+Math.imul(E,se)|0,s=s+Math.imul(E,oe)|0,i=i+Math.imul(_,ce)|0,r=(r=r+Math.imul(_,ue)|0)+Math.imul(w,ce)|0,s=s+Math.imul(w,ue)|0,i=i+Math.imul(g,de)|0,r=(r=r+Math.imul(g,fe)|0)+Math.imul(v,de)|0,s=s+Math.imul(v,fe)|0;var Me=(u+(i=i+Math.imul(h,he)|0)|0)+((8191&(r=(r=r+Math.imul(h,me)|0)+Math.imul(m,he)|0))<<13)|0;u=((s=s+Math.imul(m,me)|0)+(r>>>13)|0)+(Me>>>26)|0,Me&=67108863,i=Math.imul(q,$),r=(r=Math.imul(q,G))+Math.imul(N,$)|0,s=Math.imul(N,G),i=i+Math.imul(O,Y)|0,r=(r=r+Math.imul(O,Z)|0)+Math.imul(P,Y)|0,s=s+Math.imul(P,Z)|0,i=i+Math.imul(B,Q)|0,r=(r=r+Math.imul(B,ee)|0)+Math.imul(R,Q)|0,s=s+Math.imul(R,ee)|0,i=i+Math.imul(T,ne)|0,r=(r=r+Math.imul(T,ie)|0)+Math.imul(j,ne)|0,s=s+Math.imul(j,ie)|0,i=i+Math.imul(M,se)|0,r=(r=r+Math.imul(M,oe)|0)+Math.imul(A,se)|0,s=s+Math.imul(A,oe)|0,i=i+Math.imul(k,ce)|0,r=(r=r+Math.imul(k,ue)|0)+Math.imul(E,ce)|0,s=s+Math.imul(E,ue)|0,i=i+Math.imul(_,de)|0,r=(r=r+Math.imul(_,fe)|0)+Math.imul(w,de)|0,s=s+Math.imul(w,fe)|0;var Ae=(u+(i=i+Math.imul(g,he)|0)|0)+((8191&(r=(r=r+Math.imul(g,me)|0)+Math.imul(v,he)|0))<<13)|0;u=((s=s+Math.imul(v,me)|0)+(r>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,i=Math.imul(q,Y),r=(r=Math.imul(q,Z))+Math.imul(N,Y)|0,s=Math.imul(N,Z),i=i+Math.imul(O,Q)|0,r=(r=r+Math.imul(O,ee)|0)+Math.imul(P,Q)|0,s=s+Math.imul(P,ee)|0,i=i+Math.imul(B,ne)|0,r=(r=r+Math.imul(B,ie)|0)+Math.imul(R,ne)|0,s=s+Math.imul(R,ie)|0,i=i+Math.imul(T,se)|0,r=(r=r+Math.imul(T,oe)|0)+Math.imul(j,se)|0,s=s+Math.imul(j,oe)|0,i=i+Math.imul(M,ce)|0,r=(r=r+Math.imul(M,ue)|0)+Math.imul(A,ce)|0,s=s+Math.imul(A,ue)|0,i=i+Math.imul(k,de)|0,r=(r=r+Math.imul(k,fe)|0)+Math.imul(E,de)|0,s=s+Math.imul(E,fe)|0;var Ie=(u+(i=i+Math.imul(_,he)|0)|0)+((8191&(r=(r=r+Math.imul(_,me)|0)+Math.imul(w,he)|0))<<13)|0;u=((s=s+Math.imul(w,me)|0)+(r>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,i=Math.imul(q,Q),r=(r=Math.imul(q,ee))+Math.imul(N,Q)|0,s=Math.imul(N,ee),i=i+Math.imul(O,ne)|0,r=(r=r+Math.imul(O,ie)|0)+Math.imul(P,ne)|0,s=s+Math.imul(P,ie)|0,i=i+Math.imul(B,se)|0,r=(r=r+Math.imul(B,oe)|0)+Math.imul(R,se)|0,s=s+Math.imul(R,oe)|0,i=i+Math.imul(T,ce)|0,r=(r=r+Math.imul(T,ue)|0)+Math.imul(j,ce)|0,s=s+Math.imul(j,ue)|0,i=i+Math.imul(M,de)|0,r=(r=r+Math.imul(M,fe)|0)+Math.imul(A,de)|0,s=s+Math.imul(A,fe)|0;var Te=(u+(i=i+Math.imul(k,he)|0)|0)+((8191&(r=(r=r+Math.imul(k,me)|0)+Math.imul(E,he)|0))<<13)|0;u=((s=s+Math.imul(E,me)|0)+(r>>>13)|0)+(Te>>>26)|0,Te&=67108863,i=Math.imul(q,ne),r=(r=Math.imul(q,ie))+Math.imul(N,ne)|0,s=Math.imul(N,ie),i=i+Math.imul(O,se)|0,r=(r=r+Math.imul(O,oe)|0)+Math.imul(P,se)|0,s=s+Math.imul(P,oe)|0,i=i+Math.imul(B,ce)|0,r=(r=r+Math.imul(B,ue)|0)+Math.imul(R,ce)|0,s=s+Math.imul(R,ue)|0,i=i+Math.imul(T,de)|0,r=(r=r+Math.imul(T,fe)|0)+Math.imul(j,de)|0,s=s+Math.imul(j,fe)|0;var je=(u+(i=i+Math.imul(M,he)|0)|0)+((8191&(r=(r=r+Math.imul(M,me)|0)+Math.imul(A,he)|0))<<13)|0;u=((s=s+Math.imul(A,me)|0)+(r>>>13)|0)+(je>>>26)|0,je&=67108863,i=Math.imul(q,se),r=(r=Math.imul(q,oe))+Math.imul(N,se)|0,s=Math.imul(N,oe),i=i+Math.imul(O,ce)|0,r=(r=r+Math.imul(O,ue)|0)+Math.imul(P,ce)|0,s=s+Math.imul(P,ue)|0,i=i+Math.imul(B,de)|0,r=(r=r+Math.imul(B,fe)|0)+Math.imul(R,de)|0,s=s+Math.imul(R,fe)|0;var Ce=(u+(i=i+Math.imul(T,he)|0)|0)+((8191&(r=(r=r+Math.imul(T,me)|0)+Math.imul(j,he)|0))<<13)|0;u=((s=s+Math.imul(j,me)|0)+(r>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,i=Math.imul(q,ce),r=(r=Math.imul(q,ue))+Math.imul(N,ce)|0,s=Math.imul(N,ue),i=i+Math.imul(O,de)|0,r=(r=r+Math.imul(O,fe)|0)+Math.imul(P,de)|0,s=s+Math.imul(P,fe)|0;var Be=(u+(i=i+Math.imul(B,he)|0)|0)+((8191&(r=(r=r+Math.imul(B,me)|0)+Math.imul(R,he)|0))<<13)|0;u=((s=s+Math.imul(R,me)|0)+(r>>>13)|0)+(Be>>>26)|0,Be&=67108863,i=Math.imul(q,de),r=(r=Math.imul(q,fe))+Math.imul(N,de)|0,s=Math.imul(N,fe);var Re=(u+(i=i+Math.imul(O,he)|0)|0)+((8191&(r=(r=r+Math.imul(O,me)|0)+Math.imul(P,he)|0))<<13)|0;u=((s=s+Math.imul(P,me)|0)+(r>>>13)|0)+(Re>>>26)|0,Re&=67108863;var Le=(u+(i=Math.imul(q,he))|0)+((8191&(r=(r=Math.imul(q,me))+Math.imul(N,he)|0))<<13)|0;return u=((s=Math.imul(N,me))+(r>>>13)|0)+(Le>>>26)|0,Le&=67108863,c[0]=be,c[1]=ge,c[2]=ve,c[3]=ye,c[4]=_e,c[5]=we,c[6]=xe,c[7]=ke,c[8]=Ee,c[9]=Se,c[10]=Me,c[11]=Ae,c[12]=Ie,c[13]=Te,c[14]=je,c[15]=Ce,c[16]=Be,c[17]=Re,c[18]=Le,0!==u&&(c[19]=u,n.length++),n};function g(e,t,n){n.negative=t.negative^e.negative,n.length=e.length+t.length;for(var i=0,r=0,s=0;s>>26)|0)>>>26,o&=67108863}n.words[s]=a,i=o,o=r}return 0!==i?n.words[s]=i:n.length--,n._strip()}function v(e,t,n){return g(e,t,n)}function y(e,t){this.x=e,this.y=t}Math.imul||(b=m),s.prototype.mulTo=function(e,t){var n=this.length+e.length;return 10===this.length&&10===e.length?b(this,e,t):n<63?m(this,e,t):n<1024?g(this,e,t):v(this,e,t)},y.prototype.makeRBT=function(e){for(var t=new Array(e),n=s.prototype._countBits(e)-1,i=0;i>=1;return i},y.prototype.permute=function(e,t,n,i,r,s){for(var o=0;o>>=1)r++;return 1<>>=13,n[2*o+1]=8191&s,s>>>=13;for(o=2*t;o>=26,n+=s/67108864|0,n+=o>>>26,this.words[r]=67108863&o}return 0!==n&&(this.words[r]=n,this.length++),t?this.ineg():this},s.prototype.muln=function(e){return this.clone().imuln(e)},s.prototype.sqr=function(){return this.mul(this)},s.prototype.isqr=function(){return this.imul(this.clone())},s.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),n=0;n>>r&1}return t}(e);if(0===t.length)return new s(1);for(var n=this,i=0;i=0);var t,n=e%26,r=(e-n)/26,s=67108863>>>26-n<<26-n;if(0!==n){var o=0;for(t=0;t>>26-n}o&&(this.words[t]=o,this.length++)}if(0!==r){for(t=this.length-1;t>=0;t--)this.words[t+r]=this.words[t];for(t=0;t=0),r=t?(t-t%26)/26:0;var s=e%26,o=Math.min((e-s)/26,this.length),a=67108863^67108863>>>s<o)for(this.length-=o,u=0;u=0&&(0!==l||u>=r);u--){var d=0|this.words[u];this.words[u]=l<<26-s|d>>>s,l=d&a}return c&&0!==l&&(c.words[c.length++]=l),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},s.prototype.ishrn=function(e,t,n){return i(0===this.negative),this.iushrn(e,t,n)},s.prototype.shln=function(e){return this.clone().ishln(e)},s.prototype.ushln=function(e){return this.clone().iushln(e)},s.prototype.shrn=function(e){return this.clone().ishrn(e)},s.prototype.ushrn=function(e){return this.clone().iushrn(e)},s.prototype.testn=function(e){i("number"==typeof e&&e>=0);var t=e%26,n=(e-t)/26,r=1<=0);var t=e%26,n=(e-t)/26;if(i(0===this.negative,"imaskn works only with positive numbers"),this.length<=n)return this;if(0!==t&&n++,this.length=Math.min(n,this.length),0!==t){var r=67108863^67108863>>>t<=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},s.prototype.isubn=function(e){if(i("number"==typeof e),i(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t>26)-(c/67108864|0),this.words[r+n]=67108863&s}for(;r>26,this.words[r+n]=67108863&s;if(0===a)return this._strip();for(i(-1===a),a=0,r=0;r>26,this.words[r]=67108863&s;return this.negative=1,this._strip()},s.prototype._wordDiv=function(e,t){var n=(this.length,e.length),i=this.clone(),r=e,o=0|r.words[r.length-1];0!==(n=26-this._countBits(o))&&(r=r.ushln(n),i.iushln(n),o=0|r.words[r.length-1]);var a,c=i.length-r.length;if("mod"!==t){(a=new s(null)).length=c+1,a.words=new Array(a.length);for(var u=0;u=0;d--){var f=67108864*(0|i.words[r.length+d])+(0|i.words[r.length+d-1]);for(f=Math.min(f/o|0,67108863),i._ishlnsubmul(r,f,d);0!==i.negative;)f--,i.negative=0,i._ishlnsubmul(r,1,d),i.isZero()||(i.negative^=1);a&&(a.words[d]=f)}return a&&a._strip(),i._strip(),"div"!==t&&0!==n&&i.iushrn(n),{div:a||null,mod:i}},s.prototype.divmod=function(e,t,n){return i(!e.isZero()),this.isZero()?{div:new s(0),mod:new s(0)}:0!==this.negative&&0===e.negative?(a=this.neg().divmod(e,t),"mod"!==t&&(r=a.div.neg()),"div"!==t&&(o=a.mod.neg(),n&&0!==o.negative&&o.iadd(e)),{div:r,mod:o}):0===this.negative&&0!==e.negative?(a=this.divmod(e.neg(),t),"mod"!==t&&(r=a.div.neg()),{div:r,mod:a.mod}):0!=(this.negative&e.negative)?(a=this.neg().divmod(e.neg(),t),"div"!==t&&(o=a.mod.neg(),n&&0!==o.negative&&o.isub(e)),{div:a.div,mod:o}):e.length>this.length||this.cmp(e)<0?{div:new s(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new s(this.modrn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new s(this.modrn(e.words[0]))}:this._wordDiv(e,t);var r,o,a},s.prototype.div=function(e){return this.divmod(e,"div",!1).div},s.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},s.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},s.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var n=0!==t.div.negative?t.mod.isub(e):t.mod,i=e.ushrn(1),r=e.andln(1),s=n.cmp(i);return s<0||1===r&&0===s?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},s.prototype.modrn=function(e){var t=e<0;t&&(e=-e),i(e<=67108863);for(var n=(1<<26)%e,r=0,s=this.length-1;s>=0;s--)r=(n*r+(0|this.words[s]))%e;return t?-r:r},s.prototype.modn=function(e){return this.modrn(e)},s.prototype.idivn=function(e){var t=e<0;t&&(e=-e),i(e<=67108863);for(var n=0,r=this.length-1;r>=0;r--){var s=(0|this.words[r])+67108864*n;this.words[r]=s/e|0,n=s%e}return this._strip(),t?this.ineg():this},s.prototype.divn=function(e){return this.clone().idivn(e)},s.prototype.egcd=function(e){i(0===e.negative),i(!e.isZero());var t=this,n=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var r=new s(1),o=new s(0),a=new s(0),c=new s(1),u=0;t.isEven()&&n.isEven();)t.iushrn(1),n.iushrn(1),++u;for(var l=n.clone(),d=t.clone();!t.isZero();){for(var f=0,p=1;0==(t.words[0]&p)&&f<26;++f,p<<=1);if(f>0)for(t.iushrn(f);f-- >0;)(r.isOdd()||o.isOdd())&&(r.iadd(l),o.isub(d)),r.iushrn(1),o.iushrn(1);for(var h=0,m=1;0==(n.words[0]&m)&&h<26;++h,m<<=1);if(h>0)for(n.iushrn(h);h-- >0;)(a.isOdd()||c.isOdd())&&(a.iadd(l),c.isub(d)),a.iushrn(1),c.iushrn(1);t.cmp(n)>=0?(t.isub(n),r.isub(a),o.isub(c)):(n.isub(t),a.isub(r),c.isub(o))}return{a:a,b:c,gcd:n.iushln(u)}},s.prototype._invmp=function(e){i(0===e.negative),i(!e.isZero());var t=this,n=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var r,o=new s(1),a=new s(0),c=n.clone();t.cmpn(1)>0&&n.cmpn(1)>0;){for(var u=0,l=1;0==(t.words[0]&l)&&u<26;++u,l<<=1);if(u>0)for(t.iushrn(u);u-- >0;)o.isOdd()&&o.iadd(c),o.iushrn(1);for(var d=0,f=1;0==(n.words[0]&f)&&d<26;++d,f<<=1);if(d>0)for(n.iushrn(d);d-- >0;)a.isOdd()&&a.iadd(c),a.iushrn(1);t.cmp(n)>=0?(t.isub(n),o.isub(a)):(n.isub(t),a.isub(o))}return(r=0===t.cmpn(1)?o:a).cmpn(0)<0&&r.iadd(e),r},s.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),n=e.clone();t.negative=0,n.negative=0;for(var i=0;t.isEven()&&n.isEven();i++)t.iushrn(1),n.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;n.isEven();)n.iushrn(1);var r=t.cmp(n);if(r<0){var s=t;t=n,n=s}else if(0===r||0===n.cmpn(1))break;t.isub(n)}return n.iushln(i)},s.prototype.invm=function(e){return this.egcd(e).a.umod(e)},s.prototype.isEven=function(){return 0==(1&this.words[0])},s.prototype.isOdd=function(){return 1==(1&this.words[0])},s.prototype.andln=function(e){return this.words[0]&e},s.prototype.bincn=function(e){i("number"==typeof e);var t=e%26,n=(e-t)/26,r=1<>>26,a&=67108863,this.words[o]=a}return 0!==s&&(this.words[o]=s,this.length++),this},s.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},s.prototype.cmpn=function(e){var t,n=e<0;if(0!==this.negative&&!n)return-1;if(0===this.negative&&n)return 1;if(this._strip(),this.length>1)t=1;else{n&&(e=-e),i(e<=67108863,"Number is too big");var r=0|this.words[0];t=r===e?0:re.length)return 1;if(this.length=0;n--){var i=0|this.words[n],r=0|e.words[n];if(i!==r){ir&&(t=1);break}}return t},s.prototype.gtn=function(e){return 1===this.cmpn(e)},s.prototype.gt=function(e){return 1===this.cmp(e)},s.prototype.gten=function(e){return this.cmpn(e)>=0},s.prototype.gte=function(e){return this.cmp(e)>=0},s.prototype.ltn=function(e){return-1===this.cmpn(e)},s.prototype.lt=function(e){return-1===this.cmp(e)},s.prototype.lten=function(e){return this.cmpn(e)<=0},s.prototype.lte=function(e){return this.cmp(e)<=0},s.prototype.eqn=function(e){return 0===this.cmpn(e)},s.prototype.eq=function(e){return 0===this.cmp(e)},s.red=function(e){return new M(e)},s.prototype.toRed=function(e){return i(!this.red,"Already a number in reduction context"),i(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},s.prototype.fromRed=function(){return i(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},s.prototype._forceRed=function(e){return this.red=e,this},s.prototype.forceRed=function(e){return i(!this.red,"Already a number in reduction context"),this._forceRed(e)},s.prototype.redAdd=function(e){return i(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},s.prototype.redIAdd=function(e){return i(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},s.prototype.redSub=function(e){return i(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},s.prototype.redISub=function(e){return i(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},s.prototype.redShl=function(e){return i(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},s.prototype.redMul=function(e){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},s.prototype.redIMul=function(e){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},s.prototype.redSqr=function(){return i(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},s.prototype.redISqr=function(){return i(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},s.prototype.redSqrt=function(){return i(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},s.prototype.redInvm=function(){return i(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},s.prototype.redNeg=function(){return i(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},s.prototype.redPow=function(e){return i(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var _={k256:null,p224:null,p192:null,p25519:null};function w(e,t){this.name=e,this.p=new s(t,16),this.n=this.p.bitLength(),this.k=new s(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function x(){w.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function k(){w.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function E(){w.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function S(){w.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function M(e){if("string"==typeof e){var t=s._prime(e);this.m=t.p,this.prime=t}else i(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function A(e){M.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new s(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}w.prototype._tmp=function(){var e=new s(null);return e.words=new Array(Math.ceil(this.n/13)),e},w.prototype.ireduce=function(e){var t,n=e;do{this.split(n,this.tmp),t=(n=(n=this.imulK(n)).iadd(this.tmp)).bitLength()}while(t>this.n);var i=t0?n.isub(this.p):void 0!==n.strip?n.strip():n._strip(),n},w.prototype.split=function(e,t){e.iushrn(this.n,0,t)},w.prototype.imulK=function(e){return e.imul(this.k)},r(x,w),x.prototype.split=function(e,t){for(var n=4194303,i=Math.min(e.length,9),r=0;r>>22,s=o}s>>>=22,e.words[r-10]=s,0===s&&e.length>10?e.length-=10:e.length-=9},x.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,n=0;n>>=26,e.words[n]=r,t=i}return 0!==t&&(e.words[e.length++]=t),e},s._prime=function(e){if(_[e])return _[e];var t;if("k256"===e)t=new x;else if("p224"===e)t=new k;else if("p192"===e)t=new E;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new S}return _[e]=t,t},M.prototype._verify1=function(e){i(0===e.negative,"red works only with positives"),i(e.red,"red works only with red numbers")},M.prototype._verify2=function(e,t){i(0==(e.negative|t.negative),"red works only with positives"),i(e.red&&e.red===t.red,"red works only with red numbers")},M.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):(l(e,e.umod(this.m)._forceRed(this)),e)},M.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},M.prototype.add=function(e,t){this._verify2(e,t);var n=e.add(t);return n.cmp(this.m)>=0&&n.isub(this.m),n._forceRed(this)},M.prototype.iadd=function(e,t){this._verify2(e,t);var n=e.iadd(t);return n.cmp(this.m)>=0&&n.isub(this.m),n},M.prototype.sub=function(e,t){this._verify2(e,t);var n=e.sub(t);return n.cmpn(0)<0&&n.iadd(this.m),n._forceRed(this)},M.prototype.isub=function(e,t){this._verify2(e,t);var n=e.isub(t);return n.cmpn(0)<0&&n.iadd(this.m),n},M.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},M.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},M.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},M.prototype.isqr=function(e){return this.imul(e,e.clone())},M.prototype.sqr=function(e){return this.mul(e,e)},M.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(i(t%2==1),3===t){var n=this.m.add(new s(1)).iushrn(2);return this.pow(e,n)}for(var r=this.m.subn(1),o=0;!r.isZero()&&0===r.andln(1);)o++,r.iushrn(1);i(!r.isZero());var a=new s(1).toRed(this),c=a.redNeg(),u=this.m.subn(1).iushrn(1),l=this.m.bitLength();for(l=new s(2*l*l).toRed(this);0!==this.pow(l,u).cmp(c);)l.redIAdd(c);for(var d=this.pow(l,r),f=this.pow(e,r.addn(1).iushrn(1)),p=this.pow(e,r),h=o;0!==p.cmp(a);){for(var m=p,b=0;0!==m.cmp(a);b++)m=m.redSqr();i(b=0;i--){for(var u=t.words[i],l=c-1;l>=0;l--){var d=u>>l&1;r!==n[0]&&(r=this.sqr(r)),0!==d||0!==o?(o<<=1,o|=d,(4===++a||0===i&&0===l)&&(r=this.mul(r,n[o]),a=0,o=0)):a=0}c=26}return r},M.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},M.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},s.mont=function(e){return new A(e)},r(A,M),A.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},A.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},A.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var n=e.imul(t),i=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),r=n.isub(i).iushrn(this.shift),s=r;return r.cmp(this.m)>=0?s=r.isub(this.m):r.cmpn(0)<0&&(s=r.iadd(this.m)),s._forceRed(this)},A.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new s(0)._forceRed(this);var n=e.mul(t),i=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),r=n.isub(i).iushrn(this.shift),o=r;return r.cmp(this.m)>=0?o=r.isub(this.m):r.cmpn(0)<0&&(o=r.iadd(this.m)),o._forceRed(this)},A.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(void 0===t||t,this)},{buffer:73}],72:[function(e,t,n){var i;function r(e){this.rand=e}if(t.exports=function(e){return i||(i=new r(null)),i.generate(e)},t.exports.Rand=r,r.prototype.generate=function(e){return this._rand(e)},r.prototype._rand=function(e){if(this.rand.getBytes)return this.rand.getBytes(e);for(var t=new Uint8Array(e),n=0;n>>24]^l[h>>>16&255]^d[m>>>8&255]^f[255&b]^t[g++],o=u[h>>>24]^l[m>>>16&255]^d[b>>>8&255]^f[255&p]^t[g++],a=u[m>>>24]^l[b>>>16&255]^d[p>>>8&255]^f[255&h]^t[g++],c=u[b>>>24]^l[p>>>16&255]^d[h>>>8&255]^f[255&m]^t[g++],p=s,h=o,m=a,b=c;return s=(i[p>>>24]<<24|i[h>>>16&255]<<16|i[m>>>8&255]<<8|i[255&b])^t[g++],o=(i[h>>>24]<<24|i[m>>>16&255]<<16|i[b>>>8&255]<<8|i[255&p])^t[g++],a=(i[m>>>24]<<24|i[b>>>16&255]<<16|i[p>>>8&255]<<8|i[255&h])^t[g++],c=(i[b>>>24]<<24|i[p>>>16&255]<<16|i[h>>>8&255]<<8|i[255&m])^t[g++],[s>>>=0,o>>>=0,a>>>=0,c>>>=0]}var a=[0,1,2,4,8,16,32,64,128,27,54],c=function(){for(var e=new Array(256),t=0;t<256;t++)e[t]=t<128?t<<1:t<<1^283;for(var n=[],i=[],r=[[],[],[],[]],s=[[],[],[],[]],o=0,a=0,c=0;c<256;++c){var u=a^a<<1^a<<2^a<<3^a<<4;u=u>>>8^255&u^99,n[o]=u,i[u]=o;var l=e[o],d=e[l],f=e[d],p=257*e[u]^16843008*u;r[0][o]=p<<24|p>>>8,r[1][o]=p<<16|p>>>16,r[2][o]=p<<8|p>>>24,r[3][o]=p,p=16843009*f^65537*d^257*l^16843008*o,s[0][u]=p<<24|p>>>8,s[1][u]=p<<16|p>>>16,s[2][u]=p<<8|p>>>24,s[3][u]=p,0===o?o=a=1:(o=l^e[e[e[f^l]]],a^=e[e[a]])}return{SBOX:n,INV_SBOX:i,SUB_MIX:r,INV_SUB_MIX:s}}();function u(e){this._key=r(e),this._reset()}u.blockSize=16,u.keySize=32,u.prototype.blockSize=u.blockSize,u.prototype.keySize=u.keySize,u.prototype._reset=function(){for(var e=this._key,t=e.length,n=t+6,i=4*(n+1),r=[],s=0;s>>24,o=c.SBOX[o>>>24]<<24|c.SBOX[o>>>16&255]<<16|c.SBOX[o>>>8&255]<<8|c.SBOX[255&o],o^=a[s/t|0]<<24):t>6&&s%t==4&&(o=c.SBOX[o>>>24]<<24|c.SBOX[o>>>16&255]<<16|c.SBOX[o>>>8&255]<<8|c.SBOX[255&o]),r[s]=r[s-t]^o}for(var u=[],l=0;l>>24]]^c.INV_SUB_MIX[1][c.SBOX[f>>>16&255]]^c.INV_SUB_MIX[2][c.SBOX[f>>>8&255]]^c.INV_SUB_MIX[3][c.SBOX[255&f]]}this._nRounds=n,this._keySchedule=r,this._invKeySchedule=u},u.prototype.encryptBlockRaw=function(e){return o(e=r(e),this._keySchedule,c.SUB_MIX,c.SBOX,this._nRounds)},u.prototype.encryptBlock=function(e){var t=this.encryptBlockRaw(e),n=i.allocUnsafe(16);return n.writeUInt32BE(t[0],0),n.writeUInt32BE(t[1],4),n.writeUInt32BE(t[2],8),n.writeUInt32BE(t[3],12),n},u.prototype.decryptBlock=function(e){var t=(e=r(e))[1];e[1]=e[3],e[3]=t;var n=o(e,this._invKeySchedule,c.INV_SUB_MIX,c.INV_SBOX,this._nRounds),s=i.allocUnsafe(16);return s.writeUInt32BE(n[0],0),s.writeUInt32BE(n[3],4),s.writeUInt32BE(n[2],8),s.writeUInt32BE(n[1],12),s},u.prototype.scrub=function(){s(this._keySchedule),s(this._invKeySchedule),s(this._key)},t.exports.AES=u},{"safe-buffer":386}],75:[function(e,t,n){var i=e("./aes"),r=e("safe-buffer").Buffer,s=e("cipher-base"),o=e("inherits"),a=e("./ghash"),c=e("buffer-xor"),u=e("./incr32");function l(e,t,n,o){s.call(this);var c=r.alloc(4,0);this._cipher=new i.AES(t);var l=this._cipher.encryptBlock(c);this._ghash=new a(l),n=function(e,t,n){if(12===t.length)return e._finID=r.concat([t,r.from([0,0,0,1])]),r.concat([t,r.from([0,0,0,2])]);var i=new a(n),s=t.length,o=s%16;i.update(t),o&&(o=16-o,i.update(r.alloc(o,0))),i.update(r.alloc(8,0));var c=8*s,l=r.alloc(8);l.writeUIntBE(c,0,8),i.update(l),e._finID=i.state;var d=r.from(e._finID);return u(d),d}(this,n,l),this._prev=r.from(n),this._cache=r.allocUnsafe(0),this._secCache=r.allocUnsafe(0),this._decrypt=o,this._alen=0,this._len=0,this._mode=e,this._authTag=null,this._called=!1}o(l,s),l.prototype._update=function(e){if(!this._called&&this._alen){var t=16-this._alen%16;t<16&&(t=r.alloc(t,0),this._ghash.update(t))}this._called=!0;var n=this._mode.encrypt(this,e);return this._decrypt?this._ghash.update(e):this._ghash.update(n),this._len+=e.length,n},l.prototype._final=function(){if(this._decrypt&&!this._authTag)throw new Error("Unsupported state or unable to authenticate data");var e=c(this._ghash.final(8*this._alen,8*this._len),this._cipher.encryptBlock(this._finID));if(this._decrypt&&function(e,t){var n=0;e.length!==t.length&&n++;for(var i=Math.min(e.length,t.length),r=0;r16)throw new Error("unable to decrypt data");var n=-1;for(;++n16)return t=this.cache.slice(0,16),this.cache=this.cache.slice(16),t}else if(this.cache.length>=16)return t=this.cache.slice(0,16),this.cache=this.cache.slice(16),t;return null},d.prototype.flush=function(){if(this.cache.length)return this.cache},n.createDecipher=function(e,t){var n=s[e.toLowerCase()];if(!n)throw new TypeError("invalid suite type");var i=u(t,!1,n.key,n.iv);return f(e,i.key,i.iv)},n.createDecipheriv=f},{"./aes":74,"./authCipher":75,"./modes":87,"./streamCipher":90,"cipher-base":140,evp_bytestokey:197,inherits:249,"safe-buffer":386}],78:[function(e,t,n){var i=e("./modes"),r=e("./authCipher"),s=e("safe-buffer").Buffer,o=e("./streamCipher"),a=e("cipher-base"),c=e("./aes"),u=e("evp_bytestokey");function l(e,t,n){a.call(this),this._cache=new f,this._cipher=new c.AES(t),this._prev=s.from(n),this._mode=e,this._autopadding=!0}e("inherits")(l,a),l.prototype._update=function(e){var t,n;this._cache.add(e);for(var i=[];t=this._cache.get();)n=this._mode.encrypt(this,t),i.push(n);return s.concat(i)};var d=s.alloc(16,16);function f(){this.cache=s.allocUnsafe(0)}function p(e,t,n){var a=i[e.toLowerCase()];if(!a)throw new TypeError("invalid suite type");if("string"==typeof t&&(t=s.from(t)),t.length!==a.key/8)throw new TypeError("invalid key length "+t.length);if("string"==typeof n&&(n=s.from(n)),"GCM"!==a.mode&&n.length!==a.iv)throw new TypeError("invalid iv length "+n.length);return"stream"===a.type?new o(a.module,t,n):"auth"===a.type?new r(a.module,t,n):new l(a.module,t,n)}l.prototype._final=function(){var e=this._cache.flush();if(this._autopadding)return e=this._mode.encrypt(this,e),this._cipher.scrub(),e;if(!e.equals(d))throw this._cipher.scrub(),new Error("data not multiple of block length")},l.prototype.setAutoPadding=function(e){return this._autopadding=!!e,this},f.prototype.add=function(e){this.cache=s.concat([this.cache,e])},f.prototype.get=function(){if(this.cache.length>15){var e=this.cache.slice(0,16);return this.cache=this.cache.slice(16),e}return null},f.prototype.flush=function(){for(var e=16-this.cache.length,t=s.allocUnsafe(e),n=-1;++n>>0,0),t.writeUInt32BE(e[1]>>>0,4),t.writeUInt32BE(e[2]>>>0,8),t.writeUInt32BE(e[3]>>>0,12),t}function o(e){this.h=e,this.state=i.alloc(16,0),this.cache=i.allocUnsafe(0)}o.prototype.ghash=function(e){for(var t=-1;++t0;t--)i[t]=i[t]>>>1|(1&i[t-1])<<31;i[0]=i[0]>>>1,n&&(i[0]=i[0]^225<<24)}this.state=s(r)},o.prototype.update=function(e){var t;for(this.cache=i.concat([this.cache,e]);this.cache.length>=16;)t=this.cache.slice(0,16),this.cache=this.cache.slice(16),this.ghash(t)},o.prototype.final=function(e,t){return this.cache.length&&this.ghash(i.concat([this.cache,r],16)),this.ghash(s([0,e,0,t])),this.state},t.exports=o},{"safe-buffer":386}],80:[function(e,t,n){t.exports=function(e){for(var t,n=e.length;n--;){if(255!==(t=e.readUInt8(n))){t++,e.writeUInt8(t,n);break}e.writeUInt8(0,n)}}},{}],81:[function(e,t,n){var i=e("buffer-xor");n.encrypt=function(e,t){var n=i(t,e._prev);return e._prev=e._cipher.encryptBlock(n),e._prev},n.decrypt=function(e,t){var n=e._prev;e._prev=t;var r=e._cipher.decryptBlock(t);return i(r,n)}},{"buffer-xor":120}],82:[function(e,t,n){var i=e("safe-buffer").Buffer,r=e("buffer-xor");function s(e,t,n){var s=t.length,o=r(t,e._cache);return e._cache=e._cache.slice(s),e._prev=i.concat([e._prev,n?t:o]),o}n.encrypt=function(e,t,n){for(var r,o=i.allocUnsafe(0);t.length;){if(0===e._cache.length&&(e._cache=e._cipher.encryptBlock(e._prev),e._prev=i.allocUnsafe(0)),!(e._cache.length<=t.length)){o=i.concat([o,s(e,t,n)]);break}r=e._cache.length,o=i.concat([o,s(e,t.slice(0,r),n)]),t=t.slice(r)}return o}},{"buffer-xor":120,"safe-buffer":386}],83:[function(e,t,n){var i=e("safe-buffer").Buffer;function r(e,t,n){for(var i,r,o=-1,a=0;++o<8;)i=t&1<<7-o?128:0,a+=(128&(r=e._cipher.encryptBlock(e._prev)[0]^i))>>o%8,e._prev=s(e._prev,n?i:r);return a}function s(e,t){var n=e.length,r=-1,s=i.allocUnsafe(e.length);for(e=i.concat([e,i.from([t])]);++r>7;return s}n.encrypt=function(e,t,n){for(var s=t.length,o=i.allocUnsafe(s),a=-1;++a=0||!t.umod(e.prime1)||!t.umod(e.prime2));return t}function o(e,t){var r=function(e){var t=s(e);return{blinder:t.toRed(i.mont(e.modulus)).redPow(new i(e.publicExponent)).fromRed(),unblinder:t.invm(e.modulus)}}(t),o=t.modulus.byteLength(),a=new i(e).mul(r.blinder).umod(t.modulus),c=a.toRed(i.mont(t.prime1)),u=a.toRed(i.mont(t.prime2)),l=t.coefficient,d=t.prime1,f=t.prime2,p=c.redPow(t.exponent1).fromRed(),h=u.redPow(t.exponent2).fromRed(),m=p.isub(h).imul(l).umod(d).imul(f);return h.iadd(m).imul(r.unblinder).umod(t.modulus).toArrayLike(n,"be",o)}o.getr=s,t.exports=o}).call(this)}).call(this,e("buffer").Buffer)},{"bn.js":71,buffer:116,randombytes:358}],95:[function(e,t,n){t.exports=e("./browser/algorithms.json")},{"./browser/algorithms.json":96}],96:[function(e,t,n){t.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"}}},{}],97:[function(e,t,n){t.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"}},{}],98:[function(e,t,n){var i=e("safe-buffer").Buffer,r=e("create-hash"),s=e("readable-stream"),o=e("inherits"),a=e("./sign"),c=e("./verify"),u=e("./algorithms.json");function l(e){s.Writable.call(this);var t=u[e];if(!t)throw new Error("Unknown message digest");this._hashType=t.hash,this._hash=r(t.hash),this._tag=t.id,this._signType=t.sign}function d(e){s.Writable.call(this);var t=u[e];if(!t)throw new Error("Unknown message digest");this._hash=r(t.hash),this._tag=t.id,this._signType=t.sign}function f(e){return new l(e)}function p(e){return new d(e)}Object.keys(u).forEach((function(e){u[e].id=i.from(u[e].id,"hex"),u[e.toLowerCase()]=u[e]})),o(l,s.Writable),l.prototype._write=function(e,t,n){this._hash.update(e),n()},l.prototype.update=function(e,t){return"string"==typeof e&&(e=i.from(e,t)),this._hash.update(e),this},l.prototype.sign=function(e,t){this.end();var n=this._hash.digest(),i=a(n,e,this._hashType,this._signType,this._tag);return t?i.toString(t):i},o(d,s.Writable),d.prototype._write=function(e,t,n){this._hash.update(e),n()},d.prototype.update=function(e,t){return"string"==typeof e&&(e=i.from(e,t)),this._hash.update(e),this},d.prototype.verify=function(e,t,n){"string"==typeof t&&(t=i.from(t,n)),this.end();var r=this._hash.digest();return c(t,r,e,this._signType,this._tag)},t.exports={Sign:f,Verify:p,createSign:f,createVerify:p}},{"./algorithms.json":96,"./sign":99,"./verify":100,"create-hash":145,inherits:249,"readable-stream":115,"safe-buffer":386}],99:[function(e,t,n){var i=e("safe-buffer").Buffer,r=e("create-hmac"),s=e("browserify-rsa"),o=e("elliptic").ec,a=e("bn.js"),c=e("parse-asn1"),u=e("./curves.json");function l(e,t,n,s){if((e=i.from(e.toArray())).length0&&n.ishrn(i),n}function f(e,t,n){var s,o;do{for(s=i.alloc(0);8*s.length=t)throw new Error("invalid sig")}t.exports=function(e,t,n,u,l){var d=o(n);if("ec"===d.type){if("ecdsa"!==u&&"ecdsa/rsa"!==u)throw new Error("wrong public key type");return function(e,t,n){var i=a[n.data.algorithm.curve.join(".")];if(!i)throw new Error("unknown curve "+n.data.algorithm.curve.join("."));var r=new s(i),o=n.data.subjectPrivateKey.data;return r.verify(t,e,o)}(e,t,d)}if("dsa"===d.type){if("dsa"!==u)throw new Error("wrong public key type");return function(e,t,n){var i=n.data.p,s=n.data.q,a=n.data.g,u=n.data.pub_key,l=o.signature.decode(e,"der"),d=l.s,f=l.r;c(d,s),c(f,s);var p=r.mont(i),h=d.invm(s);return 0===a.toRed(p).redPow(new r(t).mul(h).mod(s)).fromRed().mul(u.toRed(p).redPow(f.mul(h).mod(s)).fromRed()).mod(i).mod(s).cmp(f)}(e,t,d)}if("rsa"!==u&&"ecdsa/rsa"!==u)throw new Error("wrong public key type");t=i.concat([l,t]);for(var f=d.modulus.byteLength(),p=[1],h=0;t.length+p.length+2=this.size;){this._bufferedBytes-=this.size;const e=[];let t=0;for(;t=48&&i<=57?i-48:i>=65&&i<=70?i-55:i>=97&&i<=102?i-87:void n(!1,"Invalid character in "+e)}function c(e,t,i){var n=o(e,i);return i-1>=t&&(n|=o(e,i-1)<<4),n}function l(e,t,i,r){for(var s=0,a=0,o=Math.min(e.length,i),c=t;c=49?l-49+10:l>=17?l-17+10:l,n(l>=0&&a0?e:t},s.min=function(e,t){return e.cmp(t)<0?e:t},s.prototype._init=function(e,t,i){if("number"==typeof e)return this._initNumber(e,t,i);if("object"==typeof e)return this._initArray(e,t,i);"hex"===t&&(t=16),n(t===(0|t)&&t>=2&&t<=36);var r=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(r++,this.negative=1),r=0;r-=3)a=e[r]|e[r-1]<<8|e[r-2]<<16,this.words[s]|=a<>>26-o&67108863,(o+=24)>=26&&(o-=26,s++);else if("le"===i)for(r=0,s=0;r>>26-o&67108863,(o+=24)>=26&&(o-=26,s++);return this._strip()},s.prototype._parseHex=function(e,t,i){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var n=0;n=t;n-=2)r=c(e,t,n)<=18?(s-=18,a+=1,this.words[a]|=r>>>26):s+=8;else for(n=(e.length-t)%2==0?t+1:t;n=18?(s-=18,a+=1,this.words[a]|=r>>>26):s+=8;this._strip()},s.prototype._parseBase=function(e,t,i){this.words=[0],this.length=1;for(var n=0,r=1;r<=67108863;r*=t)n++;n--,r=r/t|0;for(var s=e.length-i,a=s%n,o=Math.min(s,s-a)+i,c=0,u=i;u1&&0===this.words[this.length-1];)this.length--;return this._normSign()},s.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"undefined"!=typeof Symbol&&"function"==typeof Symbol.for)try{s.prototype[Symbol.for("nodejs.util.inspect.custom")]=p}catch(e){s.prototype.inspect=p}else s.prototype.inspect=p;function p(){return(this.red?""}var d=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],f=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],h=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];s.prototype.toString=function(e,t){var i;if(t=0|t||1,16===(e=e||10)||"hex"===e){i="";for(var r=0,s=0,a=0;a>>24-r&16777215)||a!==this.length-1?d[6-c.length]+c+i:c+i,(r+=2)>=26&&(r-=26,a--)}for(0!==s&&(i=s.toString(16)+i);i.length%t!=0;)i="0"+i;return 0!==this.negative&&(i="-"+i),i}if(e===(0|e)&&e>=2&&e<=36){var l=f[e],u=h[e];i="";var p=this.clone();for(p.negative=0;!p.isZero();){var m=p.modrn(u).toString(e);i=(p=p.idivn(u)).isZero()?m+i:d[l-m.length]+m+i}for(this.isZero()&&(i="0"+i);i.length%t!=0;)i="0"+i;return 0!==this.negative&&(i="-"+i),i}n(!1,"Base should be between 2 and 36")},s.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},s.prototype.toJSON=function(){return this.toString(16,2)},a&&(s.prototype.toBuffer=function(e,t){return this.toArrayLike(a,e,t)}),s.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)};function m(e,t,i){i.negative=t.negative^e.negative;var n=e.length+t.length|0;i.length=n,n=n-1|0;var r=0|e.words[0],s=0|t.words[0],a=r*s,o=67108863&a,c=a/67108864|0;i.words[0]=o;for(var l=1;l>>26,p=67108863&c,d=Math.min(l,t.length-1),f=Math.max(0,l-e.length+1);f<=d;f++){var h=l-f|0;u+=(a=(r=0|e.words[h])*(s=0|t.words[f])+p)/67108864|0,p=67108863&a}i.words[l]=0|p,c=0|u}return 0!==c?i.words[l]=0|c:i.length--,i._strip()}s.prototype.toArrayLike=function(e,t,i){this._strip();var r=this.byteLength(),s=i||Math.max(1,r);n(r<=s,"byte array longer than desired length"),n(s>0,"Requested array length <= 0");var a=function(e,t){return e.allocUnsafe?e.allocUnsafe(t):new e(t)}(e,s);return this["_toArrayLike"+("le"===t?"LE":"BE")](a,r),a},s.prototype._toArrayLikeLE=function(e,t){for(var i=0,n=0,r=0,s=0;r>8&255),i>16&255),6===s?(i>24&255),n=0,s=0):(n=a>>>24,s+=2)}if(i=0&&(e[i--]=a>>8&255),i>=0&&(e[i--]=a>>16&255),6===s?(i>=0&&(e[i--]=a>>24&255),n=0,s=0):(n=a>>>24,s+=2)}if(i>=0)for(e[i--]=n;i>=0;)e[i--]=0},Math.clz32?s.prototype._countBits=function(e){return 32-Math.clz32(e)}:s.prototype._countBits=function(e){var t=e,i=0;return t>=4096&&(i+=13,t>>>=13),t>=64&&(i+=7,t>>>=7),t>=8&&(i+=4,t>>>=4),t>=2&&(i+=2,t>>>=2),i+t},s.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,i=0;return 0==(8191&t)&&(i+=13,t>>>=13),0==(127&t)&&(i+=7,t>>>=7),0==(15&t)&&(i+=4,t>>>=4),0==(3&t)&&(i+=2,t>>>=2),0==(1&t)&&i++,i},s.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},s.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},s.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},s.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var i=0;ie.length?this.clone().iand(e):e.clone().iand(this)},s.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},s.prototype.iuxor=function(e){var t,i;this.length>e.length?(t=this,i=e):(t=e,i=this);for(var n=0;ne.length?this.clone().ixor(e):e.clone().ixor(this)},s.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},s.prototype.inotn=function(e){n("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),i=e%26;this._expand(t),i>0&&t--;for(var r=0;r0&&(this.words[r]=~this.words[r]&67108863>>26-i),this._strip()},s.prototype.notn=function(e){return this.clone().inotn(e)},s.prototype.setn=function(e,t){n("number"==typeof e&&e>=0);var i=e/26|0,r=e%26;return this._expand(i+1),this.words[i]=t?this.words[i]|1<e.length?(i=this,n=e):(i=e,n=this);for(var r=0,s=0;s>>26;for(;0!==r&&s>>26;if(this.length=i.length,0!==r)this.words[this.length]=r,this.length++;else if(i!==this)for(;se.length?this.clone().iadd(e):e.clone().iadd(this)},s.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var i,n,r=this.cmp(e);if(0===r)return this.negative=0,this.length=1,this.words[0]=0,this;r>0?(i=this,n=e):(i=e,n=this);for(var s=0,a=0;a>26,this.words[a]=67108863&t;for(;0!==s&&a>26,this.words[a]=67108863&t;if(0===s&&a>>13,f=0|a[1],h=8191&f,m=f>>>13,b=0|a[2],v=8191&b,g=b>>>13,y=0|a[3],_=8191&y,x=y>>>13,w=0|a[4],k=8191&w,E=w>>>13,S=0|a[5],M=8191&S,A=S>>>13,j=0|a[6],I=8191&j,T=j>>>13,C=0|a[7],B=8191&C,R=C>>>13,L=0|a[8],O=8191&L,P=L>>>13,U=0|a[9],q=8191&U,N=U>>>13,D=0|o[0],z=8191&D,H=D>>>13,F=0|o[1],W=8191&F,K=F>>>13,V=0|o[2],$=8191&V,G=V>>>13,X=0|o[3],Y=8191&X,Z=X>>>13,J=0|o[4],Q=8191&J,ee=J>>>13,te=0|o[5],ie=8191&te,ne=te>>>13,re=0|o[6],se=8191&re,ae=re>>>13,oe=0|o[7],ce=8191&oe,le=oe>>>13,ue=0|o[8],pe=8191&ue,de=ue>>>13,fe=0|o[9],he=8191&fe,me=fe>>>13;i.negative=e.negative^t.negative,i.length=19;var be=(l+(n=Math.imul(p,z))|0)+((8191&(r=(r=Math.imul(p,H))+Math.imul(d,z)|0))<<13)|0;l=((s=Math.imul(d,H))+(r>>>13)|0)+(be>>>26)|0,be&=67108863,n=Math.imul(h,z),r=(r=Math.imul(h,H))+Math.imul(m,z)|0,s=Math.imul(m,H);var ve=(l+(n=n+Math.imul(p,W)|0)|0)+((8191&(r=(r=r+Math.imul(p,K)|0)+Math.imul(d,W)|0))<<13)|0;l=((s=s+Math.imul(d,K)|0)+(r>>>13)|0)+(ve>>>26)|0,ve&=67108863,n=Math.imul(v,z),r=(r=Math.imul(v,H))+Math.imul(g,z)|0,s=Math.imul(g,H),n=n+Math.imul(h,W)|0,r=(r=r+Math.imul(h,K)|0)+Math.imul(m,W)|0,s=s+Math.imul(m,K)|0;var ge=(l+(n=n+Math.imul(p,$)|0)|0)+((8191&(r=(r=r+Math.imul(p,G)|0)+Math.imul(d,$)|0))<<13)|0;l=((s=s+Math.imul(d,G)|0)+(r>>>13)|0)+(ge>>>26)|0,ge&=67108863,n=Math.imul(_,z),r=(r=Math.imul(_,H))+Math.imul(x,z)|0,s=Math.imul(x,H),n=n+Math.imul(v,W)|0,r=(r=r+Math.imul(v,K)|0)+Math.imul(g,W)|0,s=s+Math.imul(g,K)|0,n=n+Math.imul(h,$)|0,r=(r=r+Math.imul(h,G)|0)+Math.imul(m,$)|0,s=s+Math.imul(m,G)|0;var ye=(l+(n=n+Math.imul(p,Y)|0)|0)+((8191&(r=(r=r+Math.imul(p,Z)|0)+Math.imul(d,Y)|0))<<13)|0;l=((s=s+Math.imul(d,Z)|0)+(r>>>13)|0)+(ye>>>26)|0,ye&=67108863,n=Math.imul(k,z),r=(r=Math.imul(k,H))+Math.imul(E,z)|0,s=Math.imul(E,H),n=n+Math.imul(_,W)|0,r=(r=r+Math.imul(_,K)|0)+Math.imul(x,W)|0,s=s+Math.imul(x,K)|0,n=n+Math.imul(v,$)|0,r=(r=r+Math.imul(v,G)|0)+Math.imul(g,$)|0,s=s+Math.imul(g,G)|0,n=n+Math.imul(h,Y)|0,r=(r=r+Math.imul(h,Z)|0)+Math.imul(m,Y)|0,s=s+Math.imul(m,Z)|0;var _e=(l+(n=n+Math.imul(p,Q)|0)|0)+((8191&(r=(r=r+Math.imul(p,ee)|0)+Math.imul(d,Q)|0))<<13)|0;l=((s=s+Math.imul(d,ee)|0)+(r>>>13)|0)+(_e>>>26)|0,_e&=67108863,n=Math.imul(M,z),r=(r=Math.imul(M,H))+Math.imul(A,z)|0,s=Math.imul(A,H),n=n+Math.imul(k,W)|0,r=(r=r+Math.imul(k,K)|0)+Math.imul(E,W)|0,s=s+Math.imul(E,K)|0,n=n+Math.imul(_,$)|0,r=(r=r+Math.imul(_,G)|0)+Math.imul(x,$)|0,s=s+Math.imul(x,G)|0,n=n+Math.imul(v,Y)|0,r=(r=r+Math.imul(v,Z)|0)+Math.imul(g,Y)|0,s=s+Math.imul(g,Z)|0,n=n+Math.imul(h,Q)|0,r=(r=r+Math.imul(h,ee)|0)+Math.imul(m,Q)|0,s=s+Math.imul(m,ee)|0;var xe=(l+(n=n+Math.imul(p,ie)|0)|0)+((8191&(r=(r=r+Math.imul(p,ne)|0)+Math.imul(d,ie)|0))<<13)|0;l=((s=s+Math.imul(d,ne)|0)+(r>>>13)|0)+(xe>>>26)|0,xe&=67108863,n=Math.imul(I,z),r=(r=Math.imul(I,H))+Math.imul(T,z)|0,s=Math.imul(T,H),n=n+Math.imul(M,W)|0,r=(r=r+Math.imul(M,K)|0)+Math.imul(A,W)|0,s=s+Math.imul(A,K)|0,n=n+Math.imul(k,$)|0,r=(r=r+Math.imul(k,G)|0)+Math.imul(E,$)|0,s=s+Math.imul(E,G)|0,n=n+Math.imul(_,Y)|0,r=(r=r+Math.imul(_,Z)|0)+Math.imul(x,Y)|0,s=s+Math.imul(x,Z)|0,n=n+Math.imul(v,Q)|0,r=(r=r+Math.imul(v,ee)|0)+Math.imul(g,Q)|0,s=s+Math.imul(g,ee)|0,n=n+Math.imul(h,ie)|0,r=(r=r+Math.imul(h,ne)|0)+Math.imul(m,ie)|0,s=s+Math.imul(m,ne)|0;var we=(l+(n=n+Math.imul(p,se)|0)|0)+((8191&(r=(r=r+Math.imul(p,ae)|0)+Math.imul(d,se)|0))<<13)|0;l=((s=s+Math.imul(d,ae)|0)+(r>>>13)|0)+(we>>>26)|0,we&=67108863,n=Math.imul(B,z),r=(r=Math.imul(B,H))+Math.imul(R,z)|0,s=Math.imul(R,H),n=n+Math.imul(I,W)|0,r=(r=r+Math.imul(I,K)|0)+Math.imul(T,W)|0,s=s+Math.imul(T,K)|0,n=n+Math.imul(M,$)|0,r=(r=r+Math.imul(M,G)|0)+Math.imul(A,$)|0,s=s+Math.imul(A,G)|0,n=n+Math.imul(k,Y)|0,r=(r=r+Math.imul(k,Z)|0)+Math.imul(E,Y)|0,s=s+Math.imul(E,Z)|0,n=n+Math.imul(_,Q)|0,r=(r=r+Math.imul(_,ee)|0)+Math.imul(x,Q)|0,s=s+Math.imul(x,ee)|0,n=n+Math.imul(v,ie)|0,r=(r=r+Math.imul(v,ne)|0)+Math.imul(g,ie)|0,s=s+Math.imul(g,ne)|0,n=n+Math.imul(h,se)|0,r=(r=r+Math.imul(h,ae)|0)+Math.imul(m,se)|0,s=s+Math.imul(m,ae)|0;var ke=(l+(n=n+Math.imul(p,ce)|0)|0)+((8191&(r=(r=r+Math.imul(p,le)|0)+Math.imul(d,ce)|0))<<13)|0;l=((s=s+Math.imul(d,le)|0)+(r>>>13)|0)+(ke>>>26)|0,ke&=67108863,n=Math.imul(O,z),r=(r=Math.imul(O,H))+Math.imul(P,z)|0,s=Math.imul(P,H),n=n+Math.imul(B,W)|0,r=(r=r+Math.imul(B,K)|0)+Math.imul(R,W)|0,s=s+Math.imul(R,K)|0,n=n+Math.imul(I,$)|0,r=(r=r+Math.imul(I,G)|0)+Math.imul(T,$)|0,s=s+Math.imul(T,G)|0,n=n+Math.imul(M,Y)|0,r=(r=r+Math.imul(M,Z)|0)+Math.imul(A,Y)|0,s=s+Math.imul(A,Z)|0,n=n+Math.imul(k,Q)|0,r=(r=r+Math.imul(k,ee)|0)+Math.imul(E,Q)|0,s=s+Math.imul(E,ee)|0,n=n+Math.imul(_,ie)|0,r=(r=r+Math.imul(_,ne)|0)+Math.imul(x,ie)|0,s=s+Math.imul(x,ne)|0,n=n+Math.imul(v,se)|0,r=(r=r+Math.imul(v,ae)|0)+Math.imul(g,se)|0,s=s+Math.imul(g,ae)|0,n=n+Math.imul(h,ce)|0,r=(r=r+Math.imul(h,le)|0)+Math.imul(m,ce)|0,s=s+Math.imul(m,le)|0;var Ee=(l+(n=n+Math.imul(p,pe)|0)|0)+((8191&(r=(r=r+Math.imul(p,de)|0)+Math.imul(d,pe)|0))<<13)|0;l=((s=s+Math.imul(d,de)|0)+(r>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,n=Math.imul(q,z),r=(r=Math.imul(q,H))+Math.imul(N,z)|0,s=Math.imul(N,H),n=n+Math.imul(O,W)|0,r=(r=r+Math.imul(O,K)|0)+Math.imul(P,W)|0,s=s+Math.imul(P,K)|0,n=n+Math.imul(B,$)|0,r=(r=r+Math.imul(B,G)|0)+Math.imul(R,$)|0,s=s+Math.imul(R,G)|0,n=n+Math.imul(I,Y)|0,r=(r=r+Math.imul(I,Z)|0)+Math.imul(T,Y)|0,s=s+Math.imul(T,Z)|0,n=n+Math.imul(M,Q)|0,r=(r=r+Math.imul(M,ee)|0)+Math.imul(A,Q)|0,s=s+Math.imul(A,ee)|0,n=n+Math.imul(k,ie)|0,r=(r=r+Math.imul(k,ne)|0)+Math.imul(E,ie)|0,s=s+Math.imul(E,ne)|0,n=n+Math.imul(_,se)|0,r=(r=r+Math.imul(_,ae)|0)+Math.imul(x,se)|0,s=s+Math.imul(x,ae)|0,n=n+Math.imul(v,ce)|0,r=(r=r+Math.imul(v,le)|0)+Math.imul(g,ce)|0,s=s+Math.imul(g,le)|0,n=n+Math.imul(h,pe)|0,r=(r=r+Math.imul(h,de)|0)+Math.imul(m,pe)|0,s=s+Math.imul(m,de)|0;var Se=(l+(n=n+Math.imul(p,he)|0)|0)+((8191&(r=(r=r+Math.imul(p,me)|0)+Math.imul(d,he)|0))<<13)|0;l=((s=s+Math.imul(d,me)|0)+(r>>>13)|0)+(Se>>>26)|0,Se&=67108863,n=Math.imul(q,W),r=(r=Math.imul(q,K))+Math.imul(N,W)|0,s=Math.imul(N,K),n=n+Math.imul(O,$)|0,r=(r=r+Math.imul(O,G)|0)+Math.imul(P,$)|0,s=s+Math.imul(P,G)|0,n=n+Math.imul(B,Y)|0,r=(r=r+Math.imul(B,Z)|0)+Math.imul(R,Y)|0,s=s+Math.imul(R,Z)|0,n=n+Math.imul(I,Q)|0,r=(r=r+Math.imul(I,ee)|0)+Math.imul(T,Q)|0,s=s+Math.imul(T,ee)|0,n=n+Math.imul(M,ie)|0,r=(r=r+Math.imul(M,ne)|0)+Math.imul(A,ie)|0,s=s+Math.imul(A,ne)|0,n=n+Math.imul(k,se)|0,r=(r=r+Math.imul(k,ae)|0)+Math.imul(E,se)|0,s=s+Math.imul(E,ae)|0,n=n+Math.imul(_,ce)|0,r=(r=r+Math.imul(_,le)|0)+Math.imul(x,ce)|0,s=s+Math.imul(x,le)|0,n=n+Math.imul(v,pe)|0,r=(r=r+Math.imul(v,de)|0)+Math.imul(g,pe)|0,s=s+Math.imul(g,de)|0;var Me=(l+(n=n+Math.imul(h,he)|0)|0)+((8191&(r=(r=r+Math.imul(h,me)|0)+Math.imul(m,he)|0))<<13)|0;l=((s=s+Math.imul(m,me)|0)+(r>>>13)|0)+(Me>>>26)|0,Me&=67108863,n=Math.imul(q,$),r=(r=Math.imul(q,G))+Math.imul(N,$)|0,s=Math.imul(N,G),n=n+Math.imul(O,Y)|0,r=(r=r+Math.imul(O,Z)|0)+Math.imul(P,Y)|0,s=s+Math.imul(P,Z)|0,n=n+Math.imul(B,Q)|0,r=(r=r+Math.imul(B,ee)|0)+Math.imul(R,Q)|0,s=s+Math.imul(R,ee)|0,n=n+Math.imul(I,ie)|0,r=(r=r+Math.imul(I,ne)|0)+Math.imul(T,ie)|0,s=s+Math.imul(T,ne)|0,n=n+Math.imul(M,se)|0,r=(r=r+Math.imul(M,ae)|0)+Math.imul(A,se)|0,s=s+Math.imul(A,ae)|0,n=n+Math.imul(k,ce)|0,r=(r=r+Math.imul(k,le)|0)+Math.imul(E,ce)|0,s=s+Math.imul(E,le)|0,n=n+Math.imul(_,pe)|0,r=(r=r+Math.imul(_,de)|0)+Math.imul(x,pe)|0,s=s+Math.imul(x,de)|0;var Ae=(l+(n=n+Math.imul(v,he)|0)|0)+((8191&(r=(r=r+Math.imul(v,me)|0)+Math.imul(g,he)|0))<<13)|0;l=((s=s+Math.imul(g,me)|0)+(r>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,n=Math.imul(q,Y),r=(r=Math.imul(q,Z))+Math.imul(N,Y)|0,s=Math.imul(N,Z),n=n+Math.imul(O,Q)|0,r=(r=r+Math.imul(O,ee)|0)+Math.imul(P,Q)|0,s=s+Math.imul(P,ee)|0,n=n+Math.imul(B,ie)|0,r=(r=r+Math.imul(B,ne)|0)+Math.imul(R,ie)|0,s=s+Math.imul(R,ne)|0,n=n+Math.imul(I,se)|0,r=(r=r+Math.imul(I,ae)|0)+Math.imul(T,se)|0,s=s+Math.imul(T,ae)|0,n=n+Math.imul(M,ce)|0,r=(r=r+Math.imul(M,le)|0)+Math.imul(A,ce)|0,s=s+Math.imul(A,le)|0,n=n+Math.imul(k,pe)|0,r=(r=r+Math.imul(k,de)|0)+Math.imul(E,pe)|0,s=s+Math.imul(E,de)|0;var je=(l+(n=n+Math.imul(_,he)|0)|0)+((8191&(r=(r=r+Math.imul(_,me)|0)+Math.imul(x,he)|0))<<13)|0;l=((s=s+Math.imul(x,me)|0)+(r>>>13)|0)+(je>>>26)|0,je&=67108863,n=Math.imul(q,Q),r=(r=Math.imul(q,ee))+Math.imul(N,Q)|0,s=Math.imul(N,ee),n=n+Math.imul(O,ie)|0,r=(r=r+Math.imul(O,ne)|0)+Math.imul(P,ie)|0,s=s+Math.imul(P,ne)|0,n=n+Math.imul(B,se)|0,r=(r=r+Math.imul(B,ae)|0)+Math.imul(R,se)|0,s=s+Math.imul(R,ae)|0,n=n+Math.imul(I,ce)|0,r=(r=r+Math.imul(I,le)|0)+Math.imul(T,ce)|0,s=s+Math.imul(T,le)|0,n=n+Math.imul(M,pe)|0,r=(r=r+Math.imul(M,de)|0)+Math.imul(A,pe)|0,s=s+Math.imul(A,de)|0;var Ie=(l+(n=n+Math.imul(k,he)|0)|0)+((8191&(r=(r=r+Math.imul(k,me)|0)+Math.imul(E,he)|0))<<13)|0;l=((s=s+Math.imul(E,me)|0)+(r>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,n=Math.imul(q,ie),r=(r=Math.imul(q,ne))+Math.imul(N,ie)|0,s=Math.imul(N,ne),n=n+Math.imul(O,se)|0,r=(r=r+Math.imul(O,ae)|0)+Math.imul(P,se)|0,s=s+Math.imul(P,ae)|0,n=n+Math.imul(B,ce)|0,r=(r=r+Math.imul(B,le)|0)+Math.imul(R,ce)|0,s=s+Math.imul(R,le)|0,n=n+Math.imul(I,pe)|0,r=(r=r+Math.imul(I,de)|0)+Math.imul(T,pe)|0,s=s+Math.imul(T,de)|0;var Te=(l+(n=n+Math.imul(M,he)|0)|0)+((8191&(r=(r=r+Math.imul(M,me)|0)+Math.imul(A,he)|0))<<13)|0;l=((s=s+Math.imul(A,me)|0)+(r>>>13)|0)+(Te>>>26)|0,Te&=67108863,n=Math.imul(q,se),r=(r=Math.imul(q,ae))+Math.imul(N,se)|0,s=Math.imul(N,ae),n=n+Math.imul(O,ce)|0,r=(r=r+Math.imul(O,le)|0)+Math.imul(P,ce)|0,s=s+Math.imul(P,le)|0,n=n+Math.imul(B,pe)|0,r=(r=r+Math.imul(B,de)|0)+Math.imul(R,pe)|0,s=s+Math.imul(R,de)|0;var Ce=(l+(n=n+Math.imul(I,he)|0)|0)+((8191&(r=(r=r+Math.imul(I,me)|0)+Math.imul(T,he)|0))<<13)|0;l=((s=s+Math.imul(T,me)|0)+(r>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,n=Math.imul(q,ce),r=(r=Math.imul(q,le))+Math.imul(N,ce)|0,s=Math.imul(N,le),n=n+Math.imul(O,pe)|0,r=(r=r+Math.imul(O,de)|0)+Math.imul(P,pe)|0,s=s+Math.imul(P,de)|0;var Be=(l+(n=n+Math.imul(B,he)|0)|0)+((8191&(r=(r=r+Math.imul(B,me)|0)+Math.imul(R,he)|0))<<13)|0;l=((s=s+Math.imul(R,me)|0)+(r>>>13)|0)+(Be>>>26)|0,Be&=67108863,n=Math.imul(q,pe),r=(r=Math.imul(q,de))+Math.imul(N,pe)|0,s=Math.imul(N,de);var Re=(l+(n=n+Math.imul(O,he)|0)|0)+((8191&(r=(r=r+Math.imul(O,me)|0)+Math.imul(P,he)|0))<<13)|0;l=((s=s+Math.imul(P,me)|0)+(r>>>13)|0)+(Re>>>26)|0,Re&=67108863;var Le=(l+(n=Math.imul(q,he))|0)+((8191&(r=(r=Math.imul(q,me))+Math.imul(N,he)|0))<<13)|0;return l=((s=Math.imul(N,me))+(r>>>13)|0)+(Le>>>26)|0,Le&=67108863,c[0]=be,c[1]=ve,c[2]=ge,c[3]=ye,c[4]=_e,c[5]=xe,c[6]=we,c[7]=ke,c[8]=Ee,c[9]=Se,c[10]=Me,c[11]=Ae,c[12]=je,c[13]=Ie,c[14]=Te,c[15]=Ce,c[16]=Be,c[17]=Re,c[18]=Le,0!==l&&(c[19]=l,i.length++),i};function v(e,t,i){i.negative=t.negative^e.negative,i.length=e.length+t.length;for(var n=0,r=0,s=0;s>>26)|0)>>>26,a&=67108863}i.words[s]=o,n=a,a=r}return 0!==n?i.words[s]=n:i.length--,i._strip()}function g(e,t,i){return v(e,t,i)}function y(e,t){this.x=e,this.y=t}Math.imul||(b=m),s.prototype.mulTo=function(e,t){var i=this.length+e.length;return 10===this.length&&10===e.length?b(this,e,t):i<63?m(this,e,t):i<1024?v(this,e,t):g(this,e,t)},y.prototype.makeRBT=function(e){for(var t=new Array(e),i=s.prototype._countBits(e)-1,n=0;n>=1;return n},y.prototype.permute=function(e,t,i,n,r,s){for(var a=0;a>>=1)r++;return 1<>>=13,i[2*a+1]=8191&s,s>>>=13;for(a=2*t;a>=26,i+=s/67108864|0,i+=a>>>26,this.words[r]=67108863&a}return 0!==i&&(this.words[r]=i,this.length++),t?this.ineg():this},s.prototype.muln=function(e){return this.clone().imuln(e)},s.prototype.sqr=function(){return this.mul(this)},s.prototype.isqr=function(){return this.imul(this.clone())},s.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),i=0;i>>r&1}return t}(e);if(0===t.length)return new s(1);for(var i=this,n=0;n=0);var t,i=e%26,r=(e-i)/26,s=67108863>>>26-i<<26-i;if(0!==i){var a=0;for(t=0;t>>26-i}a&&(this.words[t]=a,this.length++)}if(0!==r){for(t=this.length-1;t>=0;t--)this.words[t+r]=this.words[t];for(t=0;t=0),r=t?(t-t%26)/26:0;var s=e%26,a=Math.min((e-s)/26,this.length),o=67108863^67108863>>>s<a)for(this.length-=a,l=0;l=0&&(0!==u||l>=r);l--){var p=0|this.words[l];this.words[l]=u<<26-s|p>>>s,u=p&o}return c&&0!==u&&(c.words[c.length++]=u),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},s.prototype.ishrn=function(e,t,i){return n(0===this.negative),this.iushrn(e,t,i)},s.prototype.shln=function(e){return this.clone().ishln(e)},s.prototype.ushln=function(e){return this.clone().iushln(e)},s.prototype.shrn=function(e){return this.clone().ishrn(e)},s.prototype.ushrn=function(e){return this.clone().iushrn(e)},s.prototype.testn=function(e){n("number"==typeof e&&e>=0);var t=e%26,i=(e-t)/26,r=1<=0);var t=e%26,i=(e-t)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=i)return this;if(0!==t&&i++,this.length=Math.min(i,this.length),0!==t){var r=67108863^67108863>>>t<=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},s.prototype.isubn=function(e){if(n("number"==typeof e),n(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t>26)-(c/67108864|0),this.words[r+i]=67108863&s}for(;r>26,this.words[r+i]=67108863&s;if(0===o)return this._strip();for(n(-1===o),o=0,r=0;r>26,this.words[r]=67108863&s;return this.negative=1,this._strip()},s.prototype._wordDiv=function(e,t){var i=(this.length,e.length),n=this.clone(),r=e,a=0|r.words[r.length-1];0!==(i=26-this._countBits(a))&&(r=r.ushln(i),n.iushln(i),a=0|r.words[r.length-1]);var o,c=n.length-r.length;if("mod"!==t){(o=new s(null)).length=c+1,o.words=new Array(o.length);for(var l=0;l=0;p--){var d=67108864*(0|n.words[r.length+p])+(0|n.words[r.length+p-1]);for(d=Math.min(d/a|0,67108863),n._ishlnsubmul(r,d,p);0!==n.negative;)d--,n.negative=0,n._ishlnsubmul(r,1,p),n.isZero()||(n.negative^=1);o&&(o.words[p]=d)}return o&&o._strip(),n._strip(),"div"!==t&&0!==i&&n.iushrn(i),{div:o||null,mod:n}},s.prototype.divmod=function(e,t,i){return n(!e.isZero()),this.isZero()?{div:new s(0),mod:new s(0)}:0!==this.negative&&0===e.negative?(o=this.neg().divmod(e,t),"mod"!==t&&(r=o.div.neg()),"div"!==t&&(a=o.mod.neg(),i&&0!==a.negative&&a.iadd(e)),{div:r,mod:a}):0===this.negative&&0!==e.negative?(o=this.divmod(e.neg(),t),"mod"!==t&&(r=o.div.neg()),{div:r,mod:o.mod}):0!=(this.negative&e.negative)?(o=this.neg().divmod(e.neg(),t),"div"!==t&&(a=o.mod.neg(),i&&0!==a.negative&&a.isub(e)),{div:o.div,mod:a}):e.length>this.length||this.cmp(e)<0?{div:new s(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new s(this.modrn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new s(this.modrn(e.words[0]))}:this._wordDiv(e,t);var r,a,o},s.prototype.div=function(e){return this.divmod(e,"div",!1).div},s.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},s.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},s.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var i=0!==t.div.negative?t.mod.isub(e):t.mod,n=e.ushrn(1),r=e.andln(1),s=i.cmp(n);return s<0||1===r&&0===s?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},s.prototype.modrn=function(e){var t=e<0;t&&(e=-e),n(e<=67108863);for(var i=(1<<26)%e,r=0,s=this.length-1;s>=0;s--)r=(i*r+(0|this.words[s]))%e;return t?-r:r},s.prototype.modn=function(e){return this.modrn(e)},s.prototype.idivn=function(e){var t=e<0;t&&(e=-e),n(e<=67108863);for(var i=0,r=this.length-1;r>=0;r--){var s=(0|this.words[r])+67108864*i;this.words[r]=s/e|0,i=s%e}return this._strip(),t?this.ineg():this},s.prototype.divn=function(e){return this.clone().idivn(e)},s.prototype.egcd=function(e){n(0===e.negative),n(!e.isZero());var t=this,i=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var r=new s(1),a=new s(0),o=new s(0),c=new s(1),l=0;t.isEven()&&i.isEven();)t.iushrn(1),i.iushrn(1),++l;for(var u=i.clone(),p=t.clone();!t.isZero();){for(var d=0,f=1;0==(t.words[0]&f)&&d<26;++d,f<<=1);if(d>0)for(t.iushrn(d);d-- >0;)(r.isOdd()||a.isOdd())&&(r.iadd(u),a.isub(p)),r.iushrn(1),a.iushrn(1);for(var h=0,m=1;0==(i.words[0]&m)&&h<26;++h,m<<=1);if(h>0)for(i.iushrn(h);h-- >0;)(o.isOdd()||c.isOdd())&&(o.iadd(u),c.isub(p)),o.iushrn(1),c.iushrn(1);t.cmp(i)>=0?(t.isub(i),r.isub(o),a.isub(c)):(i.isub(t),o.isub(r),c.isub(a))}return{a:o,b:c,gcd:i.iushln(l)}},s.prototype._invmp=function(e){n(0===e.negative),n(!e.isZero());var t=this,i=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var r,a=new s(1),o=new s(0),c=i.clone();t.cmpn(1)>0&&i.cmpn(1)>0;){for(var l=0,u=1;0==(t.words[0]&u)&&l<26;++l,u<<=1);if(l>0)for(t.iushrn(l);l-- >0;)a.isOdd()&&a.iadd(c),a.iushrn(1);for(var p=0,d=1;0==(i.words[0]&d)&&p<26;++p,d<<=1);if(p>0)for(i.iushrn(p);p-- >0;)o.isOdd()&&o.iadd(c),o.iushrn(1);t.cmp(i)>=0?(t.isub(i),a.isub(o)):(i.isub(t),o.isub(a))}return(r=0===t.cmpn(1)?a:o).cmpn(0)<0&&r.iadd(e),r},s.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),i=e.clone();t.negative=0,i.negative=0;for(var n=0;t.isEven()&&i.isEven();n++)t.iushrn(1),i.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;i.isEven();)i.iushrn(1);var r=t.cmp(i);if(r<0){var s=t;t=i,i=s}else if(0===r||0===i.cmpn(1))break;t.isub(i)}return i.iushln(n)},s.prototype.invm=function(e){return this.egcd(e).a.umod(e)},s.prototype.isEven=function(){return 0==(1&this.words[0])},s.prototype.isOdd=function(){return 1==(1&this.words[0])},s.prototype.andln=function(e){return this.words[0]&e},s.prototype.bincn=function(e){n("number"==typeof e);var t=e%26,i=(e-t)/26,r=1<>>26,o&=67108863,this.words[a]=o}return 0!==s&&(this.words[a]=s,this.length++),this},s.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},s.prototype.cmpn=function(e){var t,i=e<0;if(0!==this.negative&&!i)return-1;if(0===this.negative&&i)return 1;if(this._strip(),this.length>1)t=1;else{i&&(e=-e),n(e<=67108863,"Number is too big");var r=0|this.words[0];t=r===e?0:re.length)return 1;if(this.length=0;i--){var n=0|this.words[i],r=0|e.words[i];if(n!==r){nr&&(t=1);break}}return t},s.prototype.gtn=function(e){return 1===this.cmpn(e)},s.prototype.gt=function(e){return 1===this.cmp(e)},s.prototype.gten=function(e){return this.cmpn(e)>=0},s.prototype.gte=function(e){return this.cmp(e)>=0},s.prototype.ltn=function(e){return-1===this.cmpn(e)},s.prototype.lt=function(e){return-1===this.cmp(e)},s.prototype.lten=function(e){return this.cmpn(e)<=0},s.prototype.lte=function(e){return this.cmp(e)<=0},s.prototype.eqn=function(e){return 0===this.cmpn(e)},s.prototype.eq=function(e){return 0===this.cmp(e)},s.red=function(e){return new M(e)},s.prototype.toRed=function(e){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},s.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},s.prototype._forceRed=function(e){return this.red=e,this},s.prototype.forceRed=function(e){return n(!this.red,"Already a number in reduction context"),this._forceRed(e)},s.prototype.redAdd=function(e){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},s.prototype.redIAdd=function(e){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},s.prototype.redSub=function(e){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},s.prototype.redISub=function(e){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},s.prototype.redShl=function(e){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},s.prototype.redMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},s.prototype.redIMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},s.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},s.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},s.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},s.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},s.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},s.prototype.redPow=function(e){return n(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var _={k256:null,p224:null,p192:null,p25519:null};function x(e,t){this.name=e,this.p=new s(t,16),this.n=this.p.bitLength(),this.k=new s(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function w(){x.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function k(){x.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function E(){x.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function S(){x.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function M(e){if("string"==typeof e){var t=s._prime(e);this.m=t.p,this.prime=t}else n(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function A(e){M.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new s(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}x.prototype._tmp=function(){var e=new s(null);return e.words=new Array(Math.ceil(this.n/13)),e},x.prototype.ireduce=function(e){var t,i=e;do{this.split(i,this.tmp),t=(i=(i=this.imulK(i)).iadd(this.tmp)).bitLength()}while(t>this.n);var n=t0?i.isub(this.p):void 0!==i.strip?i.strip():i._strip(),i},x.prototype.split=function(e,t){e.iushrn(this.n,0,t)},x.prototype.imulK=function(e){return e.imul(this.k)},r(w,x),w.prototype.split=function(e,t){for(var i=4194303,n=Math.min(e.length,9),r=0;r>>22,s=a}s>>>=22,e.words[r-10]=s,0===s&&e.length>10?e.length-=10:e.length-=9},w.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,i=0;i>>=26,e.words[i]=r,t=n}return 0!==t&&(e.words[e.length++]=t),e},s._prime=function(e){if(_[e])return _[e];var t;if("k256"===e)t=new w;else if("p224"===e)t=new k;else if("p192"===e)t=new E;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new S}return _[e]=t,t},M.prototype._verify1=function(e){n(0===e.negative,"red works only with positives"),n(e.red,"red works only with red numbers")},M.prototype._verify2=function(e,t){n(0==(e.negative|t.negative),"red works only with positives"),n(e.red&&e.red===t.red,"red works only with red numbers")},M.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):(u(e,e.umod(this.m)._forceRed(this)),e)},M.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},M.prototype.add=function(e,t){this._verify2(e,t);var i=e.add(t);return i.cmp(this.m)>=0&&i.isub(this.m),i._forceRed(this)},M.prototype.iadd=function(e,t){this._verify2(e,t);var i=e.iadd(t);return i.cmp(this.m)>=0&&i.isub(this.m),i},M.prototype.sub=function(e,t){this._verify2(e,t);var i=e.sub(t);return i.cmpn(0)<0&&i.iadd(this.m),i._forceRed(this)},M.prototype.isub=function(e,t){this._verify2(e,t);var i=e.isub(t);return i.cmpn(0)<0&&i.iadd(this.m),i},M.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},M.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},M.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},M.prototype.isqr=function(e){return this.imul(e,e.clone())},M.prototype.sqr=function(e){return this.mul(e,e)},M.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(n(t%2==1),3===t){var i=this.m.add(new s(1)).iushrn(2);return this.pow(e,i)}for(var r=this.m.subn(1),a=0;!r.isZero()&&0===r.andln(1);)a++,r.iushrn(1);n(!r.isZero());var o=new s(1).toRed(this),c=o.redNeg(),l=this.m.subn(1).iushrn(1),u=this.m.bitLength();for(u=new s(2*u*u).toRed(this);0!==this.pow(u,l).cmp(c);)u.redIAdd(c);for(var p=this.pow(u,r),d=this.pow(e,r.addn(1).iushrn(1)),f=this.pow(e,r),h=a;0!==f.cmp(o);){for(var m=f,b=0;0!==m.cmp(o);b++)m=m.redSqr();n(b=0;n--){for(var l=t.words[n],u=c-1;u>=0;u--){var p=l>>u&1;r!==i[0]&&(r=this.sqr(r)),0!==p||0!==a?(a<<=1,a|=p,(4===++o||0===n&&0===u)&&(r=this.mul(r,i[a]),o=0,a=0)):o=0}c=26}return r},M.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},M.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},s.mont=function(e){return new A(e)},r(A,M),A.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},A.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},A.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var i=e.imul(t),n=i.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),r=i.isub(n).iushrn(this.shift),s=r;return r.cmp(this.m)>=0?s=r.isub(this.m):r.cmpn(0)<0&&(s=r.iadd(this.m)),s._forceRed(this)},A.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new s(0)._forceRed(this);var i=e.mul(t),n=i.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),r=i.isub(n).iushrn(this.shift),a=r;return r.cmp(this.m)>=0?a=r.isub(this.m):r.cmpn(0)<0&&(a=r.iadd(this.m)),a._forceRed(this)},A.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(void 0===t||t,this)},{buffer:67}],66:[function(e,t,i){var n;function r(e){this.rand=e}if(t.exports=function(e){return n||(n=new r(null)),n.generate(e)},t.exports.Rand=r,r.prototype.generate=function(e){return this._rand(e)},r.prototype._rand=function(e){if(this.rand.getBytes)return this.rand.getBytes(e);for(var t=new Uint8Array(e),i=0;i>>24]^u[h>>>16&255]^p[m>>>8&255]^d[255&b]^t[v++],a=l[h>>>24]^u[m>>>16&255]^p[b>>>8&255]^d[255&f]^t[v++],o=l[m>>>24]^u[b>>>16&255]^p[f>>>8&255]^d[255&h]^t[v++],c=l[b>>>24]^u[f>>>16&255]^p[h>>>8&255]^d[255&m]^t[v++],f=s,h=a,m=o,b=c;return s=(n[f>>>24]<<24|n[h>>>16&255]<<16|n[m>>>8&255]<<8|n[255&b])^t[v++],a=(n[h>>>24]<<24|n[m>>>16&255]<<16|n[b>>>8&255]<<8|n[255&f])^t[v++],o=(n[m>>>24]<<24|n[b>>>16&255]<<16|n[f>>>8&255]<<8|n[255&h])^t[v++],c=(n[b>>>24]<<24|n[f>>>16&255]<<16|n[h>>>8&255]<<8|n[255&m])^t[v++],[s>>>=0,a>>>=0,o>>>=0,c>>>=0]}var o=[0,1,2,4,8,16,32,64,128,27,54],c=function(){for(var e=new Array(256),t=0;t<256;t++)e[t]=t<128?t<<1:t<<1^283;for(var i=[],n=[],r=[[],[],[],[]],s=[[],[],[],[]],a=0,o=0,c=0;c<256;++c){var l=o^o<<1^o<<2^o<<3^o<<4;l=l>>>8^255&l^99,i[a]=l,n[l]=a;var u=e[a],p=e[u],d=e[p],f=257*e[l]^16843008*l;r[0][a]=f<<24|f>>>8,r[1][a]=f<<16|f>>>16,r[2][a]=f<<8|f>>>24,r[3][a]=f,f=16843009*d^65537*p^257*u^16843008*a,s[0][l]=f<<24|f>>>8,s[1][l]=f<<16|f>>>16,s[2][l]=f<<8|f>>>24,s[3][l]=f,0===a?a=o=1:(a=u^e[e[e[d^u]]],o^=e[e[o]])}return{SBOX:i,INV_SBOX:n,SUB_MIX:r,INV_SUB_MIX:s}}();function l(e){this._key=r(e),this._reset()}l.blockSize=16,l.keySize=32,l.prototype.blockSize=l.blockSize,l.prototype.keySize=l.keySize,l.prototype._reset=function(){for(var e=this._key,t=e.length,i=t+6,n=4*(i+1),r=[],s=0;s>>24,a=c.SBOX[a>>>24]<<24|c.SBOX[a>>>16&255]<<16|c.SBOX[a>>>8&255]<<8|c.SBOX[255&a],a^=o[s/t|0]<<24):t>6&&s%t==4&&(a=c.SBOX[a>>>24]<<24|c.SBOX[a>>>16&255]<<16|c.SBOX[a>>>8&255]<<8|c.SBOX[255&a]),r[s]=r[s-t]^a}for(var l=[],u=0;u>>24]]^c.INV_SUB_MIX[1][c.SBOX[d>>>16&255]]^c.INV_SUB_MIX[2][c.SBOX[d>>>8&255]]^c.INV_SUB_MIX[3][c.SBOX[255&d]]}this._nRounds=i,this._keySchedule=r,this._invKeySchedule=l},l.prototype.encryptBlockRaw=function(e){return a(e=r(e),this._keySchedule,c.SUB_MIX,c.SBOX,this._nRounds)},l.prototype.encryptBlock=function(e){var t=this.encryptBlockRaw(e),i=n.allocUnsafe(16);return i.writeUInt32BE(t[0],0),i.writeUInt32BE(t[1],4),i.writeUInt32BE(t[2],8),i.writeUInt32BE(t[3],12),i},l.prototype.decryptBlock=function(e){var t=(e=r(e))[1];e[1]=e[3],e[3]=t;var i=a(e,this._invKeySchedule,c.INV_SUB_MIX,c.INV_SBOX,this._nRounds),s=n.allocUnsafe(16);return s.writeUInt32BE(i[0],0),s.writeUInt32BE(i[3],4),s.writeUInt32BE(i[2],8),s.writeUInt32BE(i[1],12),s},l.prototype.scrub=function(){s(this._keySchedule),s(this._invKeySchedule),s(this._key)},t.exports.AES=l},{"safe-buffer":383}],69:[function(e,t,i){var n=e("./aes"),r=e("safe-buffer").Buffer,s=e("cipher-base"),a=e("inherits"),o=e("./ghash"),c=e("buffer-xor"),l=e("./incr32");function u(e,t,i,a){s.call(this);var c=r.alloc(4,0);this._cipher=new n.AES(t);var u=this._cipher.encryptBlock(c);this._ghash=new o(u),i=function(e,t,i){if(12===t.length)return e._finID=r.concat([t,r.from([0,0,0,1])]),r.concat([t,r.from([0,0,0,2])]);var n=new o(i),s=t.length,a=s%16;n.update(t),a&&(a=16-a,n.update(r.alloc(a,0))),n.update(r.alloc(8,0));var c=8*s,u=r.alloc(8);u.writeUIntBE(c,0,8),n.update(u),e._finID=n.state;var p=r.from(e._finID);return l(p),p}(this,i,u),this._prev=r.from(i),this._cache=r.allocUnsafe(0),this._secCache=r.allocUnsafe(0),this._decrypt=a,this._alen=0,this._len=0,this._mode=e,this._authTag=null,this._called=!1}a(u,s),u.prototype._update=function(e){if(!this._called&&this._alen){var t=16-this._alen%16;t<16&&(t=r.alloc(t,0),this._ghash.update(t))}this._called=!0;var i=this._mode.encrypt(this,e);return this._decrypt?this._ghash.update(e):this._ghash.update(i),this._len+=e.length,i},u.prototype._final=function(){if(this._decrypt&&!this._authTag)throw new Error("Unsupported state or unable to authenticate data");var e=c(this._ghash.final(8*this._alen,8*this._len),this._cipher.encryptBlock(this._finID));if(this._decrypt&&function(e,t){var i=0;e.length!==t.length&&i++;for(var n=Math.min(e.length,t.length),r=0;r16)throw new Error("unable to decrypt data");var i=-1;for(;++i16)return t=this.cache.slice(0,16),this.cache=this.cache.slice(16),t}else if(this.cache.length>=16)return t=this.cache.slice(0,16),this.cache=this.cache.slice(16),t;return null},p.prototype.flush=function(){if(this.cache.length)return this.cache},i.createDecipher=function(e,t){var i=s[e.toLowerCase()];if(!i)throw new TypeError("invalid suite type");var n=l(t,!1,i.key,i.iv);return d(e,n.key,n.iv)},i.createDecipheriv=d},{"./aes":68,"./authCipher":69,"./modes":81,"./streamCipher":84,"cipher-base":134,evp_bytestokey:194,inherits:246,"safe-buffer":383}],72:[function(e,t,i){var n=e("./modes"),r=e("./authCipher"),s=e("safe-buffer").Buffer,a=e("./streamCipher"),o=e("cipher-base"),c=e("./aes"),l=e("evp_bytestokey");function u(e,t,i){o.call(this),this._cache=new d,this._cipher=new c.AES(t),this._prev=s.from(i),this._mode=e,this._autopadding=!0}e("inherits")(u,o),u.prototype._update=function(e){var t,i;this._cache.add(e);for(var n=[];t=this._cache.get();)i=this._mode.encrypt(this,t),n.push(i);return s.concat(n)};var p=s.alloc(16,16);function d(){this.cache=s.allocUnsafe(0)}function f(e,t,i){var o=n[e.toLowerCase()];if(!o)throw new TypeError("invalid suite type");if("string"==typeof t&&(t=s.from(t)),t.length!==o.key/8)throw new TypeError("invalid key length "+t.length);if("string"==typeof i&&(i=s.from(i)),"GCM"!==o.mode&&i.length!==o.iv)throw new TypeError("invalid iv length "+i.length);return"stream"===o.type?new a(o.module,t,i):"auth"===o.type?new r(o.module,t,i):new u(o.module,t,i)}u.prototype._final=function(){var e=this._cache.flush();if(this._autopadding)return e=this._mode.encrypt(this,e),this._cipher.scrub(),e;if(!e.equals(p))throw this._cipher.scrub(),new Error("data not multiple of block length")},u.prototype.setAutoPadding=function(e){return this._autopadding=!!e,this},d.prototype.add=function(e){this.cache=s.concat([this.cache,e])},d.prototype.get=function(){if(this.cache.length>15){var e=this.cache.slice(0,16);return this.cache=this.cache.slice(16),e}return null},d.prototype.flush=function(){for(var e=16-this.cache.length,t=s.allocUnsafe(e),i=-1;++i>>0,0),t.writeUInt32BE(e[1]>>>0,4),t.writeUInt32BE(e[2]>>>0,8),t.writeUInt32BE(e[3]>>>0,12),t}function a(e){this.h=e,this.state=n.alloc(16,0),this.cache=n.allocUnsafe(0)}a.prototype.ghash=function(e){for(var t=-1;++t0;t--)n[t]=n[t]>>>1|(1&n[t-1])<<31;n[0]=n[0]>>>1,i&&(n[0]=n[0]^225<<24)}this.state=s(r)},a.prototype.update=function(e){var t;for(this.cache=n.concat([this.cache,e]);this.cache.length>=16;)t=this.cache.slice(0,16),this.cache=this.cache.slice(16),this.ghash(t)},a.prototype.final=function(e,t){return this.cache.length&&this.ghash(n.concat([this.cache,r],16)),this.ghash(s([0,e,0,t])),this.state},t.exports=a},{"safe-buffer":383}],74:[function(e,t,i){t.exports=function(e){for(var t,i=e.length;i--;){if(255!==(t=e.readUInt8(i))){t++,e.writeUInt8(t,i);break}e.writeUInt8(0,i)}}},{}],75:[function(e,t,i){var n=e("buffer-xor");i.encrypt=function(e,t){var i=n(t,e._prev);return e._prev=e._cipher.encryptBlock(i),e._prev},i.decrypt=function(e,t){var i=e._prev;e._prev=t;var r=e._cipher.decryptBlock(t);return n(r,i)}},{"buffer-xor":114}],76:[function(e,t,i){var n=e("safe-buffer").Buffer,r=e("buffer-xor");function s(e,t,i){var s=t.length,a=r(t,e._cache);return e._cache=e._cache.slice(s),e._prev=n.concat([e._prev,i?t:a]),a}i.encrypt=function(e,t,i){for(var r,a=n.allocUnsafe(0);t.length;){if(0===e._cache.length&&(e._cache=e._cipher.encryptBlock(e._prev),e._prev=n.allocUnsafe(0)),!(e._cache.length<=t.length)){a=n.concat([a,s(e,t,i)]);break}r=e._cache.length,a=n.concat([a,s(e,t.slice(0,r),i)]),t=t.slice(r)}return a}},{"buffer-xor":114,"safe-buffer":383}],77:[function(e,t,i){var n=e("safe-buffer").Buffer;function r(e,t,i){for(var n,r,a=-1,o=0;++a<8;)n=t&1<<7-a?128:0,o+=(128&(r=e._cipher.encryptBlock(e._prev)[0]^n))>>a%8,e._prev=s(e._prev,i?n:r);return o}function s(e,t){var i=e.length,r=-1,s=n.allocUnsafe(e.length);for(e=n.concat([e,n.from([t])]);++r>7;return s}i.encrypt=function(e,t,i){for(var s=t.length,a=n.allocUnsafe(s),o=-1;++o=0||!t.umod(e.prime1)||!t.umod(e.prime2));return t}function a(e,t){var r=function(e){var t=s(e);return{blinder:t.toRed(n.mont(e.modulus)).redPow(new n(e.publicExponent)).fromRed(),unblinder:t.invm(e.modulus)}}(t),a=t.modulus.byteLength(),o=new n(e).mul(r.blinder).umod(t.modulus),c=o.toRed(n.mont(t.prime1)),l=o.toRed(n.mont(t.prime2)),u=t.coefficient,p=t.prime1,d=t.prime2,f=c.redPow(t.exponent1).fromRed(),h=l.redPow(t.exponent2).fromRed(),m=f.isub(h).imul(u).umod(p).imul(d);return h.iadd(m).imul(r.unblinder).umod(t.modulus).toArrayLike(i,"be",a)}a.getr=s,t.exports=a}).call(this)}).call(this,e("buffer").Buffer)},{"bn.js":65,buffer:110,randombytes:357}],89:[function(e,t,i){t.exports=e("./browser/algorithms.json")},{"./browser/algorithms.json":90}],90:[function(e,t,i){t.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"}}},{}],91:[function(e,t,i){t.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"}},{}],92:[function(e,t,i){var n=e("safe-buffer").Buffer,r=e("create-hash"),s=e("readable-stream"),a=e("inherits"),o=e("./sign"),c=e("./verify"),l=e("./algorithms.json");function u(e){s.Writable.call(this);var t=l[e];if(!t)throw new Error("Unknown message digest");this._hashType=t.hash,this._hash=r(t.hash),this._tag=t.id,this._signType=t.sign}function p(e){s.Writable.call(this);var t=l[e];if(!t)throw new Error("Unknown message digest");this._hash=r(t.hash),this._tag=t.id,this._signType=t.sign}function d(e){return new u(e)}function f(e){return new p(e)}Object.keys(l).forEach((function(e){l[e].id=n.from(l[e].id,"hex"),l[e.toLowerCase()]=l[e]})),a(u,s.Writable),u.prototype._write=function(e,t,i){this._hash.update(e),i()},u.prototype.update=function(e,t){return"string"==typeof e&&(e=n.from(e,t)),this._hash.update(e),this},u.prototype.sign=function(e,t){this.end();var i=this._hash.digest(),n=o(i,e,this._hashType,this._signType,this._tag);return t?n.toString(t):n},a(p,s.Writable),p.prototype._write=function(e,t,i){this._hash.update(e),i()},p.prototype.update=function(e,t){return"string"==typeof e&&(e=n.from(e,t)),this._hash.update(e),this},p.prototype.verify=function(e,t,i){"string"==typeof t&&(t=n.from(t,i)),this.end();var r=this._hash.digest();return c(t,r,e,this._signType,this._tag)},t.exports={Sign:d,Verify:f,createSign:d,createVerify:f}},{"./algorithms.json":90,"./sign":93,"./verify":94,"create-hash":140,inherits:246,"readable-stream":109,"safe-buffer":383}],93:[function(e,t,i){var n=e("safe-buffer").Buffer,r=e("create-hmac"),s=e("browserify-rsa"),a=e("elliptic").ec,o=e("bn.js"),c=e("parse-asn1"),l=e("./curves.json");function u(e,t,i,s){if((e=n.from(e.toArray())).length0&&i.ishrn(n),i}function d(e,t,i){var s,a;do{for(s=n.alloc(0);8*s.length=t)throw new Error("invalid sig")}t.exports=function(e,t,i,l,u){var p=a(i);if("ec"===p.type){if("ecdsa"!==l&&"ecdsa/rsa"!==l)throw new Error("wrong public key type");return function(e,t,i){var n=o[i.data.algorithm.curve.join(".")];if(!n)throw new Error("unknown curve "+i.data.algorithm.curve.join("."));var r=new s(n),a=i.data.subjectPrivateKey.data;return r.verify(t,e,a)}(e,t,p)}if("dsa"===p.type){if("dsa"!==l)throw new Error("wrong public key type");return function(e,t,i){var n=i.data.p,s=i.data.q,o=i.data.g,l=i.data.pub_key,u=a.signature.decode(e,"der"),p=u.s,d=u.r;c(p,s),c(d,s);var f=r.mont(n),h=p.invm(s);return 0===o.toRed(f).redPow(new r(t).mul(h).mod(s)).fromRed().mul(l.toRed(f).redPow(d.mul(h).mod(s)).fromRed()).mod(n).mod(s).cmp(d)}(e,t,p)}if("rsa"!==l&&"ecdsa/rsa"!==l)throw new Error("wrong public key type");t=n.concat([u,t]);for(var d=p.modulus.byteLength(),f=[1],h=0;t.length+f.length+2 * @license MIT */ -"use strict";var t=e("base64-js"),i=e("ieee754");n.Buffer=o,n.SlowBuffer=function(e){+e!=e&&(e=0);return o.alloc(+e)},n.INSPECT_MAX_BYTES=50;var r=2147483647;function s(e){if(e>r)throw new RangeError('The value "'+e+'" is invalid for option "size"');var t=new Uint8Array(e);return t.__proto__=o.prototype,t}function o(e,t,n){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return u(e)}return a(e,t,n)}function a(e,t,n){if("string"==typeof e)return function(e,t){"string"==typeof t&&""!==t||(t="utf8");if(!o.isEncoding(t))throw new TypeError("Unknown encoding: "+t);var n=0|f(e,t),i=s(n),r=i.write(e,t);r!==n&&(i=i.slice(0,r));return i}(e,t);if(ArrayBuffer.isView(e))return l(e);if(null==e)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(D(e,ArrayBuffer)||e&&D(e.buffer,ArrayBuffer))return function(e,t,n){if(t<0||e.byteLength=r)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+r.toString(16)+" bytes");return 0|e}function f(e,t){if(o.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||D(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);var n=e.length,i=arguments.length>2&&!0===arguments[2];if(!i&&0===n)return 0;for(var r=!1;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":return U(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return q(e).length;default:if(r)return i?-1:U(e).length;t=(""+t).toLowerCase(),r=!0}}function p(e,t,n){var i=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return I(this,t,n);case"utf8":case"utf-8":return E(this,t,n);case"ascii":return M(this,t,n);case"latin1":case"binary":return A(this,t,n);case"base64":return k(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return T(this,t,n);default:if(i)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),i=!0}}function h(e,t,n){var i=e[t];e[t]=e[n],e[n]=i}function m(e,t,n,i,r){if(0===e.length)return-1;if("string"==typeof n?(i=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),z(n=+n)&&(n=r?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(r)return-1;n=e.length-1}else if(n<0){if(!r)return-1;n=0}if("string"==typeof t&&(t=o.from(t,i)),o.isBuffer(t))return 0===t.length?-1:b(e,t,n,i,r);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?r?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):b(e,[t],n,i,r);throw new TypeError("val must be string, number or Buffer")}function b(e,t,n,i,r){var s,o=1,a=e.length,c=t.length;if(void 0!==i&&("ucs2"===(i=String(i).toLowerCase())||"ucs-2"===i||"utf16le"===i||"utf-16le"===i)){if(e.length<2||t.length<2)return-1;o=2,a/=2,c/=2,n/=2}function u(e,t){return 1===o?e[t]:e.readUInt16BE(t*o)}if(r){var l=-1;for(s=n;sa&&(n=a-c),s=n;s>=0;s--){for(var d=!0,f=0;fr&&(i=r):i=r;var s=t.length;i>s/2&&(i=s/2);for(var o=0;o>8,r=n%256,s.push(r),s.push(i);return s}(t,e.length-n),e,n,i)}function k(e,n,i){return 0===n&&i===e.length?t.fromByteArray(e):t.fromByteArray(e.slice(n,i))}function E(e,t,n){n=Math.min(e.length,n);for(var i=[],r=t;r239?4:u>223?3:u>191?2:1;if(r+d<=n)switch(d){case 1:u<128&&(l=u);break;case 2:128==(192&(s=e[r+1]))&&(c=(31&u)<<6|63&s)>127&&(l=c);break;case 3:s=e[r+1],o=e[r+2],128==(192&s)&&128==(192&o)&&(c=(15&u)<<12|(63&s)<<6|63&o)>2047&&(c<55296||c>57343)&&(l=c);break;case 4:s=e[r+1],o=e[r+2],a=e[r+3],128==(192&s)&&128==(192&o)&&128==(192&a)&&(c=(15&u)<<18|(63&s)<<12|(63&o)<<6|63&a)>65535&&c<1114112&&(l=c)}null===l?(l=65533,d=1):l>65535&&(l-=65536,i.push(l>>>10&1023|55296),l=56320|1023&l),i.push(l),r+=d}return function(e){var t=e.length;if(t<=S)return String.fromCharCode.apply(String,e);var n="",i=0;for(;it&&(e+=" ... "),""},o.prototype.compare=function(e,t,n,i,r){if(D(e,Uint8Array)&&(e=o.from(e,e.offset,e.byteLength)),!o.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===i&&(i=0),void 0===r&&(r=this.length),t<0||n>e.length||i<0||r>this.length)throw new RangeError("out of range index");if(i>=r&&t>=n)return 0;if(i>=r)return-1;if(t>=n)return 1;if(this===e)return 0;for(var s=(r>>>=0)-(i>>>=0),a=(n>>>=0)-(t>>>=0),c=Math.min(s,a),u=this.slice(i,r),l=e.slice(t,n),d=0;d>>=0,isFinite(n)?(n>>>=0,void 0===i&&(i="utf8")):(i=n,n=void 0)}var r=this.length-t;if((void 0===n||n>r)&&(n=r),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");for(var s=!1;;)switch(i){case"hex":return g(this,e,t,n);case"utf8":case"utf-8":return v(this,e,t,n);case"ascii":return y(this,e,t,n);case"latin1":case"binary":return _(this,e,t,n);case"base64":return w(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return x(this,e,t,n);default:if(s)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),s=!0}},o.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var S=4096;function M(e,t,n){var i="";n=Math.min(e.length,n);for(var r=t;ri)&&(n=i);for(var r="",s=t;sn)throw new RangeError("Trying to access beyond buffer length")}function C(e,t,n,i,r,s){if(!o.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>r||te.length)throw new RangeError("Index out of range")}function B(e,t,n,i,r,s){if(n+i>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function R(e,t,n,r,s){return t=+t,n>>>=0,s||B(e,0,n,4),i.write(e,t,n,r,23,4),n+4}function L(e,t,n,r,s){return t=+t,n>>>=0,s||B(e,0,n,8),i.write(e,t,n,r,52,8),n+8}o.prototype.slice=function(e,t){var n=this.length;(e=~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),(t=void 0===t?n:~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),t>>=0,t>>>=0,n||j(e,t,this.length);for(var i=this[e],r=1,s=0;++s>>=0,t>>>=0,n||j(e,t,this.length);for(var i=this[e+--t],r=1;t>0&&(r*=256);)i+=this[e+--t]*r;return i},o.prototype.readUInt8=function(e,t){return e>>>=0,t||j(e,1,this.length),this[e]},o.prototype.readUInt16LE=function(e,t){return e>>>=0,t||j(e,2,this.length),this[e]|this[e+1]<<8},o.prototype.readUInt16BE=function(e,t){return e>>>=0,t||j(e,2,this.length),this[e]<<8|this[e+1]},o.prototype.readUInt32LE=function(e,t){return e>>>=0,t||j(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},o.prototype.readUInt32BE=function(e,t){return e>>>=0,t||j(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},o.prototype.readIntLE=function(e,t,n){e>>>=0,t>>>=0,n||j(e,t,this.length);for(var i=this[e],r=1,s=0;++s=(r*=128)&&(i-=Math.pow(2,8*t)),i},o.prototype.readIntBE=function(e,t,n){e>>>=0,t>>>=0,n||j(e,t,this.length);for(var i=t,r=1,s=this[e+--i];i>0&&(r*=256);)s+=this[e+--i]*r;return s>=(r*=128)&&(s-=Math.pow(2,8*t)),s},o.prototype.readInt8=function(e,t){return e>>>=0,t||j(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},o.prototype.readInt16LE=function(e,t){e>>>=0,t||j(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},o.prototype.readInt16BE=function(e,t){e>>>=0,t||j(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},o.prototype.readInt32LE=function(e,t){return e>>>=0,t||j(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},o.prototype.readInt32BE=function(e,t){return e>>>=0,t||j(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},o.prototype.readFloatLE=function(e,t){return e>>>=0,t||j(e,4,this.length),i.read(this,e,!0,23,4)},o.prototype.readFloatBE=function(e,t){return e>>>=0,t||j(e,4,this.length),i.read(this,e,!1,23,4)},o.prototype.readDoubleLE=function(e,t){return e>>>=0,t||j(e,8,this.length),i.read(this,e,!0,52,8)},o.prototype.readDoubleBE=function(e,t){return e>>>=0,t||j(e,8,this.length),i.read(this,e,!1,52,8)},o.prototype.writeUIntLE=function(e,t,n,i){(e=+e,t>>>=0,n>>>=0,i)||C(this,e,t,n,Math.pow(2,8*n)-1,0);var r=1,s=0;for(this[t]=255&e;++s>>=0,n>>>=0,i)||C(this,e,t,n,Math.pow(2,8*n)-1,0);var r=n-1,s=1;for(this[t+r]=255&e;--r>=0&&(s*=256);)this[t+r]=e/s&255;return t+n},o.prototype.writeUInt8=function(e,t,n){return e=+e,t>>>=0,n||C(this,e,t,1,255,0),this[t]=255&e,t+1},o.prototype.writeUInt16LE=function(e,t,n){return e=+e,t>>>=0,n||C(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},o.prototype.writeUInt16BE=function(e,t,n){return e=+e,t>>>=0,n||C(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},o.prototype.writeUInt32LE=function(e,t,n){return e=+e,t>>>=0,n||C(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},o.prototype.writeUInt32BE=function(e,t,n){return e=+e,t>>>=0,n||C(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},o.prototype.writeIntLE=function(e,t,n,i){if(e=+e,t>>>=0,!i){var r=Math.pow(2,8*n-1);C(this,e,t,n,r-1,-r)}var s=0,o=1,a=0;for(this[t]=255&e;++s>0)-a&255;return t+n},o.prototype.writeIntBE=function(e,t,n,i){if(e=+e,t>>>=0,!i){var r=Math.pow(2,8*n-1);C(this,e,t,n,r-1,-r)}var s=n-1,o=1,a=0;for(this[t+s]=255&e;--s>=0&&(o*=256);)e<0&&0===a&&0!==this[t+s+1]&&(a=1),this[t+s]=(e/o>>0)-a&255;return t+n},o.prototype.writeInt8=function(e,t,n){return e=+e,t>>>=0,n||C(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},o.prototype.writeInt16LE=function(e,t,n){return e=+e,t>>>=0,n||C(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},o.prototype.writeInt16BE=function(e,t,n){return e=+e,t>>>=0,n||C(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},o.prototype.writeInt32LE=function(e,t,n){return e=+e,t>>>=0,n||C(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},o.prototype.writeInt32BE=function(e,t,n){return e=+e,t>>>=0,n||C(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},o.prototype.writeFloatLE=function(e,t,n){return R(this,e,t,!0,n)},o.prototype.writeFloatBE=function(e,t,n){return R(this,e,t,!1,n)},o.prototype.writeDoubleLE=function(e,t,n){return L(this,e,t,!0,n)},o.prototype.writeDoubleBE=function(e,t,n){return L(this,e,t,!1,n)},o.prototype.copy=function(e,t,n,i){if(!o.isBuffer(e))throw new TypeError("argument should be a Buffer");if(n||(n=0),i||0===i||(i=this.length),t>=e.length&&(t=e.length),t||(t=0),i>0&&i=this.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),e.length-t=0;--s)e[s+t]=this[s+n];else Uint8Array.prototype.set.call(e,this.subarray(n,i),t);return r},o.prototype.fill=function(e,t,n,i){if("string"==typeof e){if("string"==typeof t?(i=t,t=0,n=this.length):"string"==typeof n&&(i=n,n=this.length),void 0!==i&&"string"!=typeof i)throw new TypeError("encoding must be a string");if("string"==typeof i&&!o.isEncoding(i))throw new TypeError("Unknown encoding: "+i);if(1===e.length){var r=e.charCodeAt(0);("utf8"===i&&r<128||"latin1"===i)&&(e=r)}}else"number"==typeof e&&(e&=255);if(t<0||this.length>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"==typeof e)for(s=t;s55295&&n<57344){if(!r){if(n>56319){(t-=3)>-1&&s.push(239,191,189);continue}if(o+1===i){(t-=3)>-1&&s.push(239,191,189);continue}r=n;continue}if(n<56320){(t-=3)>-1&&s.push(239,191,189),r=n;continue}n=65536+(r-55296<<10|n-56320)}else r&&(t-=3)>-1&&s.push(239,191,189);if(r=null,n<128){if((t-=1)<0)break;s.push(n)}else if(n<2048){if((t-=2)<0)break;s.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;s.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;s.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return s}function q(e){return t.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(O,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function N(e,t,n,i){for(var r=0;r=t.length||r>=e.length);++r)t[r+n]=e[r];return r}function D(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function z(e){return e!=e}}).call(this)}).call(this,e("buffer").Buffer)},{"base64-js":19,buffer:116,ieee754:247}],117:[function(e,t,n){(function(e){(function(){t.exports=function(t){if("number"!=typeof t)throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative');return e.allocUnsafe?e.allocUnsafe(t):new e(t)}}).call(this)}).call(this,e("buffer").Buffer)},{buffer:116}],118:[function(e,t,n){(function(n){(function(){var i=e("buffer-fill"),r=e("buffer-alloc-unsafe");t.exports=function(e,t,s){if("number"!=typeof e)throw new TypeError('"size" argument must be a number');if(e<0)throw new RangeError('"size" argument must not be negative');if(n.alloc)return n.alloc(e,t,s);var o=r(e);return 0===e?o:void 0===t?i(o,0):("string"!=typeof s&&(s=void 0),i(o,t,s))}}).call(this)}).call(this,e("buffer").Buffer)},{buffer:116,"buffer-alloc-unsafe":117,"buffer-fill":119}],119:[function(e,t,n){(function(e){(function(){var n=function(){try{if(!e.isEncoding("latin1"))return!1;var t=e.alloc?e.alloc(4):new e(4);return t.fill("ab","ucs2"),"61006200"===t.toString("hex")}catch(e){return!1}}();function i(e,t,n,i){if(n<0||i>e.length)throw new RangeError("Out of range index");return n>>>=0,(i=void 0===i?e.length:i>>>0)>n&&e.fill(t,n,i),e}t.exports=function(t,r,s,o,a){if(n)return t.fill(r,s,o,a);if("number"==typeof r)return i(t,r,s,o);if("string"==typeof r){if("string"==typeof s?(a=s,s=0,o=t.length):"string"==typeof o&&(a=o,o=t.length),void 0!==a&&"string"!=typeof a)throw new TypeError("encoding must be a string");if("latin1"===a&&(a="binary"),"string"==typeof a&&!e.isEncoding(a))throw new TypeError("Unknown encoding: "+a);if(""===r)return i(t,0,s,o);if(function(e){return 1===e.length&&e.charCodeAt(0)<256}(r))return i(t,r.charCodeAt(0),s,o);r=new e(r,a)}return e.isBuffer(r)?function(e,t,n,i){if(n<0||i>e.length)throw new RangeError("Out of range index");if(i<=n)return e;n>>>=0,i=void 0===i?e.length:i>>>0;for(var r=n,s=t.length;r<=i-s;)t.copy(e,r),r+=s;return r!==i&&t.copy(e,r,0,i-r),e}(t,r,s,o):i(t,0,s,o)}}).call(this)}).call(this,e("buffer").Buffer)},{buffer:116}],120:[function(e,t,n){(function(e){(function(){t.exports=function(t,n){for(var i=Math.min(t.length,n.length),r=new e(i),s=0;sr)throw new RangeError('The value "'+e+'" is invalid for option "size"');var t=new Uint8Array(e);return t.__proto__=a.prototype,t}function a(e,t,i){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return l(e)}return o(e,t,i)}function o(e,t,i){if("string"==typeof e)return function(e,t){"string"==typeof t&&""!==t||(t="utf8");if(!a.isEncoding(t))throw new TypeError("Unknown encoding: "+t);var i=0|d(e,t),n=s(i),r=n.write(e,t);r!==i&&(n=n.slice(0,r));return n}(e,t);if(ArrayBuffer.isView(e))return u(e);if(null==e)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(D(e,ArrayBuffer)||e&&D(e.buffer,ArrayBuffer))return function(e,t,i){if(t<0||e.byteLength=r)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+r.toString(16)+" bytes");return 0|e}function d(e,t){if(a.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||D(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);var i=e.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===i)return 0;for(var r=!1;;)switch(t){case"ascii":case"latin1":case"binary":return i;case"utf8":case"utf-8":return U(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*i;case"hex":return i>>>1;case"base64":return q(e).length;default:if(r)return n?-1:U(e).length;t=(""+t).toLowerCase(),r=!0}}function f(e,t,i){var n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===i||i>this.length)&&(i=this.length),i<=0)return"";if((i>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return j(this,t,i);case"utf8":case"utf-8":return E(this,t,i);case"ascii":return M(this,t,i);case"latin1":case"binary":return A(this,t,i);case"base64":return k(this,t,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return I(this,t,i);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function h(e,t,i){var n=e[t];e[t]=e[i],e[i]=n}function m(e,t,i,n,r){if(0===e.length)return-1;if("string"==typeof i?(n=i,i=0):i>2147483647?i=2147483647:i<-2147483648&&(i=-2147483648),z(i=+i)&&(i=r?0:e.length-1),i<0&&(i=e.length+i),i>=e.length){if(r)return-1;i=e.length-1}else if(i<0){if(!r)return-1;i=0}if("string"==typeof t&&(t=a.from(t,n)),a.isBuffer(t))return 0===t.length?-1:b(e,t,i,n,r);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?r?Uint8Array.prototype.indexOf.call(e,t,i):Uint8Array.prototype.lastIndexOf.call(e,t,i):b(e,[t],i,n,r);throw new TypeError("val must be string, number or Buffer")}function b(e,t,i,n,r){var s,a=1,o=e.length,c=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;a=2,o/=2,c/=2,i/=2}function l(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(r){var u=-1;for(s=i;so&&(i=o-c),s=i;s>=0;s--){for(var p=!0,d=0;dr&&(n=r):n=r;var s=t.length;n>s/2&&(n=s/2);for(var a=0;a>8,r=i%256,s.push(r),s.push(n);return s}(t,e.length-i),e,i,n)}function k(e,i,n){return 0===i&&n===e.length?t.fromByteArray(e):t.fromByteArray(e.slice(i,n))}function E(e,t,i){i=Math.min(e.length,i);for(var n=[],r=t;r239?4:l>223?3:l>191?2:1;if(r+p<=i)switch(p){case 1:l<128&&(u=l);break;case 2:128==(192&(s=e[r+1]))&&(c=(31&l)<<6|63&s)>127&&(u=c);break;case 3:s=e[r+1],a=e[r+2],128==(192&s)&&128==(192&a)&&(c=(15&l)<<12|(63&s)<<6|63&a)>2047&&(c<55296||c>57343)&&(u=c);break;case 4:s=e[r+1],a=e[r+2],o=e[r+3],128==(192&s)&&128==(192&a)&&128==(192&o)&&(c=(15&l)<<18|(63&s)<<12|(63&a)<<6|63&o)>65535&&c<1114112&&(u=c)}null===u?(u=65533,p=1):u>65535&&(u-=65536,n.push(u>>>10&1023|55296),u=56320|1023&u),n.push(u),r+=p}return function(e){var t=e.length;if(t<=S)return String.fromCharCode.apply(String,e);var i="",n=0;for(;nt&&(e+=" ... "),""},a.prototype.compare=function(e,t,i,n,r){if(D(e,Uint8Array)&&(e=a.from(e,e.offset,e.byteLength)),!a.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===i&&(i=e?e.length:0),void 0===n&&(n=0),void 0===r&&(r=this.length),t<0||i>e.length||n<0||r>this.length)throw new RangeError("out of range index");if(n>=r&&t>=i)return 0;if(n>=r)return-1;if(t>=i)return 1;if(this===e)return 0;for(var s=(r>>>=0)-(n>>>=0),o=(i>>>=0)-(t>>>=0),c=Math.min(s,o),l=this.slice(n,r),u=e.slice(t,i),p=0;p>>=0,isFinite(i)?(i>>>=0,void 0===n&&(n="utf8")):(n=i,i=void 0)}var r=this.length-t;if((void 0===i||i>r)&&(i=r),e.length>0&&(i<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var s=!1;;)switch(n){case"hex":return v(this,e,t,i);case"utf8":case"utf-8":return g(this,e,t,i);case"ascii":return y(this,e,t,i);case"latin1":case"binary":return _(this,e,t,i);case"base64":return x(this,e,t,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return w(this,e,t,i);default:if(s)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),s=!0}},a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var S=4096;function M(e,t,i){var n="";i=Math.min(e.length,i);for(var r=t;rn)&&(i=n);for(var r="",s=t;si)throw new RangeError("Trying to access beyond buffer length")}function C(e,t,i,n,r,s){if(!a.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>r||te.length)throw new RangeError("Index out of range")}function B(e,t,i,n,r,s){if(i+n>e.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("Index out of range")}function R(e,t,i,r,s){return t=+t,i>>>=0,s||B(e,0,i,4),n.write(e,t,i,r,23,4),i+4}function L(e,t,i,r,s){return t=+t,i>>>=0,s||B(e,0,i,8),n.write(e,t,i,r,52,8),i+8}a.prototype.slice=function(e,t){var i=this.length;(e=~~e)<0?(e+=i)<0&&(e=0):e>i&&(e=i),(t=void 0===t?i:~~t)<0?(t+=i)<0&&(t=0):t>i&&(t=i),t>>=0,t>>>=0,i||T(e,t,this.length);for(var n=this[e],r=1,s=0;++s>>=0,t>>>=0,i||T(e,t,this.length);for(var n=this[e+--t],r=1;t>0&&(r*=256);)n+=this[e+--t]*r;return n},a.prototype.readUInt8=function(e,t){return e>>>=0,t||T(e,1,this.length),this[e]},a.prototype.readUInt16LE=function(e,t){return e>>>=0,t||T(e,2,this.length),this[e]|this[e+1]<<8},a.prototype.readUInt16BE=function(e,t){return e>>>=0,t||T(e,2,this.length),this[e]<<8|this[e+1]},a.prototype.readUInt32LE=function(e,t){return e>>>=0,t||T(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},a.prototype.readUInt32BE=function(e,t){return e>>>=0,t||T(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},a.prototype.readIntLE=function(e,t,i){e>>>=0,t>>>=0,i||T(e,t,this.length);for(var n=this[e],r=1,s=0;++s=(r*=128)&&(n-=Math.pow(2,8*t)),n},a.prototype.readIntBE=function(e,t,i){e>>>=0,t>>>=0,i||T(e,t,this.length);for(var n=t,r=1,s=this[e+--n];n>0&&(r*=256);)s+=this[e+--n]*r;return s>=(r*=128)&&(s-=Math.pow(2,8*t)),s},a.prototype.readInt8=function(e,t){return e>>>=0,t||T(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},a.prototype.readInt16LE=function(e,t){e>>>=0,t||T(e,2,this.length);var i=this[e]|this[e+1]<<8;return 32768&i?4294901760|i:i},a.prototype.readInt16BE=function(e,t){e>>>=0,t||T(e,2,this.length);var i=this[e+1]|this[e]<<8;return 32768&i?4294901760|i:i},a.prototype.readInt32LE=function(e,t){return e>>>=0,t||T(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},a.prototype.readInt32BE=function(e,t){return e>>>=0,t||T(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},a.prototype.readFloatLE=function(e,t){return e>>>=0,t||T(e,4,this.length),n.read(this,e,!0,23,4)},a.prototype.readFloatBE=function(e,t){return e>>>=0,t||T(e,4,this.length),n.read(this,e,!1,23,4)},a.prototype.readDoubleLE=function(e,t){return e>>>=0,t||T(e,8,this.length),n.read(this,e,!0,52,8)},a.prototype.readDoubleBE=function(e,t){return e>>>=0,t||T(e,8,this.length),n.read(this,e,!1,52,8)},a.prototype.writeUIntLE=function(e,t,i,n){(e=+e,t>>>=0,i>>>=0,n)||C(this,e,t,i,Math.pow(2,8*i)-1,0);var r=1,s=0;for(this[t]=255&e;++s>>=0,i>>>=0,n)||C(this,e,t,i,Math.pow(2,8*i)-1,0);var r=i-1,s=1;for(this[t+r]=255&e;--r>=0&&(s*=256);)this[t+r]=e/s&255;return t+i},a.prototype.writeUInt8=function(e,t,i){return e=+e,t>>>=0,i||C(this,e,t,1,255,0),this[t]=255&e,t+1},a.prototype.writeUInt16LE=function(e,t,i){return e=+e,t>>>=0,i||C(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},a.prototype.writeUInt16BE=function(e,t,i){return e=+e,t>>>=0,i||C(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},a.prototype.writeUInt32LE=function(e,t,i){return e=+e,t>>>=0,i||C(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},a.prototype.writeUInt32BE=function(e,t,i){return e=+e,t>>>=0,i||C(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},a.prototype.writeIntLE=function(e,t,i,n){if(e=+e,t>>>=0,!n){var r=Math.pow(2,8*i-1);C(this,e,t,i,r-1,-r)}var s=0,a=1,o=0;for(this[t]=255&e;++s>0)-o&255;return t+i},a.prototype.writeIntBE=function(e,t,i,n){if(e=+e,t>>>=0,!n){var r=Math.pow(2,8*i-1);C(this,e,t,i,r-1,-r)}var s=i-1,a=1,o=0;for(this[t+s]=255&e;--s>=0&&(a*=256);)e<0&&0===o&&0!==this[t+s+1]&&(o=1),this[t+s]=(e/a>>0)-o&255;return t+i},a.prototype.writeInt8=function(e,t,i){return e=+e,t>>>=0,i||C(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},a.prototype.writeInt16LE=function(e,t,i){return e=+e,t>>>=0,i||C(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},a.prototype.writeInt16BE=function(e,t,i){return e=+e,t>>>=0,i||C(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},a.prototype.writeInt32LE=function(e,t,i){return e=+e,t>>>=0,i||C(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},a.prototype.writeInt32BE=function(e,t,i){return e=+e,t>>>=0,i||C(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},a.prototype.writeFloatLE=function(e,t,i){return R(this,e,t,!0,i)},a.prototype.writeFloatBE=function(e,t,i){return R(this,e,t,!1,i)},a.prototype.writeDoubleLE=function(e,t,i){return L(this,e,t,!0,i)},a.prototype.writeDoubleBE=function(e,t,i){return L(this,e,t,!1,i)},a.prototype.copy=function(e,t,i,n){if(!a.isBuffer(e))throw new TypeError("argument should be a Buffer");if(i||(i=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t=0;--s)e[s+t]=this[s+i];else Uint8Array.prototype.set.call(e,this.subarray(i,n),t);return r},a.prototype.fill=function(e,t,i,n){if("string"==typeof e){if("string"==typeof t?(n=t,t=0,i=this.length):"string"==typeof i&&(n=i,i=this.length),void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!a.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(1===e.length){var r=e.charCodeAt(0);("utf8"===n&&r<128||"latin1"===n)&&(e=r)}}else"number"==typeof e&&(e&=255);if(t<0||this.length>>=0,i=void 0===i?this.length:i>>>0,e||(e=0),"number"==typeof e)for(s=t;s55295&&i<57344){if(!r){if(i>56319){(t-=3)>-1&&s.push(239,191,189);continue}if(a+1===n){(t-=3)>-1&&s.push(239,191,189);continue}r=i;continue}if(i<56320){(t-=3)>-1&&s.push(239,191,189),r=i;continue}i=65536+(r-55296<<10|i-56320)}else r&&(t-=3)>-1&&s.push(239,191,189);if(r=null,i<128){if((t-=1)<0)break;s.push(i)}else if(i<2048){if((t-=2)<0)break;s.push(i>>6|192,63&i|128)}else if(i<65536){if((t-=3)<0)break;s.push(i>>12|224,i>>6&63|128,63&i|128)}else{if(!(i<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;s.push(i>>18|240,i>>12&63|128,i>>6&63|128,63&i|128)}}return s}function q(e){return t.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(O,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function N(e,t,i,n){for(var r=0;r=t.length||r>=e.length);++r)t[r+i]=e[r];return r}function D(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function z(e){return e!=e}}).call(this)}).call(this,e("buffer").Buffer)},{"base64-js":19,buffer:110,ieee754:244}],111:[function(e,t,i){(function(e){(function(){t.exports=function(t){if("number"!=typeof t)throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative');return e.allocUnsafe?e.allocUnsafe(t):new e(t)}}).call(this)}).call(this,e("buffer").Buffer)},{buffer:110}],112:[function(e,t,i){(function(i){(function(){var n=e("buffer-fill"),r=e("buffer-alloc-unsafe");t.exports=function(e,t,s){if("number"!=typeof e)throw new TypeError('"size" argument must be a number');if(e<0)throw new RangeError('"size" argument must not be negative');if(i.alloc)return i.alloc(e,t,s);var a=r(e);return 0===e?a:void 0===t?n(a,0):("string"!=typeof s&&(s=void 0),n(a,t,s))}}).call(this)}).call(this,e("buffer").Buffer)},{buffer:110,"buffer-alloc-unsafe":111,"buffer-fill":113}],113:[function(e,t,i){(function(e){(function(){var i=function(){try{if(!e.isEncoding("latin1"))return!1;var t=e.alloc?e.alloc(4):new e(4);return t.fill("ab","ucs2"),"61006200"===t.toString("hex")}catch(e){return!1}}();function n(e,t,i,n){if(i<0||n>e.length)throw new RangeError("Out of range index");return i>>>=0,(n=void 0===n?e.length:n>>>0)>i&&e.fill(t,i,n),e}t.exports=function(t,r,s,a,o){if(i)return t.fill(r,s,a,o);if("number"==typeof r)return n(t,r,s,a);if("string"==typeof r){if("string"==typeof s?(o=s,s=0,a=t.length):"string"==typeof a&&(o=a,a=t.length),void 0!==o&&"string"!=typeof o)throw new TypeError("encoding must be a string");if("latin1"===o&&(o="binary"),"string"==typeof o&&!e.isEncoding(o))throw new TypeError("Unknown encoding: "+o);if(""===r)return n(t,0,s,a);if(function(e){return 1===e.length&&e.charCodeAt(0)<256}(r))return n(t,r.charCodeAt(0),s,a);r=new e(r,o)}return e.isBuffer(r)?function(e,t,i,n){if(i<0||n>e.length)throw new RangeError("Out of range index");if(n<=i)return e;i>>>=0,n=void 0===n?e.length:n>>>0;for(var r=i,s=t.length;r<=n-s;)t.copy(e,r),r+=s;return r!==n&&t.copy(e,r,0,n-r),e}(t,r,s,a):n(t,0,s,a)}}).call(this)}).call(this,e("buffer").Buffer)},{buffer:110}],114:[function(e,t,i){(function(e){(function(){t.exports=function(t,i){for(var n=Math.min(t.length,i.length),r=new e(n),s=0;s=s.pb?"PB":n>=s.tb?"TB":n>=s.gb?"GB":n>=s.mb?"MB":n>=s.kb?"KB":"B");var d=(e/s[l.toLowerCase()]).toFixed(c);return u||(d=d.replace(r,"$1")),o&&(d=d.replace(i,o)),d+a+l}function c(e){if("number"==typeof e&&!isNaN(e))return e;if("string"!=typeof e)return null;var t,n=o.exec(e),i="b";return n?(t=parseFloat(n[1]),i=n[4].toLowerCase()):(t=parseInt(e,10),i="b"),Math.floor(s[i]*t)}},{}],123:[function(e,t,n){ +"use strict";t.exports=function(e,t){if("string"==typeof e)return c(e);if("number"==typeof e)return o(e,t);return null},t.exports.format=o,t.exports.parse=c;var n=/\B(?=(\d{3})+(?!\d))/g,r=/(?:\.0*|(\.[^0]+)0+)$/,s={b:1,kb:1024,mb:1<<20,gb:1<<30,tb:Math.pow(1024,4),pb:Math.pow(1024,5)},a=/^((-|\+)?(\d+(?:\.\d+)?)) *(kb|mb|gb|tb|pb)$/i;function o(e,t){if(!Number.isFinite(e))return null;var i=Math.abs(e),a=t&&t.thousandsSeparator||"",o=t&&t.unitSeparator||"",c=t&&void 0!==t.decimalPlaces?t.decimalPlaces:2,l=Boolean(t&&t.fixedDecimals),u=t&&t.unit||"";u&&s[u.toLowerCase()]||(u=i>=s.pb?"PB":i>=s.tb?"TB":i>=s.gb?"GB":i>=s.mb?"MB":i>=s.kb?"KB":"B");var p=(e/s[u.toLowerCase()]).toFixed(c);return l||(p=p.replace(r,"$1")),a&&(p=p.replace(n,a)),p+o+u}function c(e){if("number"==typeof e&&!isNaN(e))return e;if("string"!=typeof e)return null;var t,i=a.exec(e),n="b";return i?(t=parseFloat(i[1]),n=i[4].toLowerCase()):(t=parseInt(e,10),n="b"),Math.floor(s[n]*t)}},{}],117:[function(e,t,i){ /*! cache-chunk-store. MIT License. Feross Aboukhadijeh */ -const i=e("lru"),r=e("queue-microtask");t.exports=class{constructor(e,t){if(this.store=e,this.chunkLength=e.chunkLength,this.inProgressGets=new Map,!this.store||!this.store.get||!this.store.put)throw new Error("First argument must be abstract-chunk-store compliant");this.cache=new i(t)}put(e,t,n=(()=>{})){if(!this.cache)return r((()=>n(new Error("CacheStore closed"))));this.cache.remove(e),this.store.put(e,t,n)}get(e,t,n=(()=>{})){if("function"==typeof t)return this.get(e,null,t);if(!this.cache)return r((()=>n(new Error("CacheStore closed"))));t||(t={});let i=this.cache.get(e);if(i){const e=t.offset||0,s=t.length||i.length-e;return 0===e&&s===i.length||(i=i.slice(e,s+e)),r((()=>n(null,i)))}let s=this.inProgressGets.get(e);const o=!!s;s||(s=[],this.inProgressGets.set(e,s)),s.push({opts:t,cb:n}),o||this.store.get(e,((t,n)=>{t||null==this.cache||this.cache.set(e,n);const i=this.inProgressGets.get(e);this.inProgressGets.delete(e);for(const{opts:e,cb:r}of i)if(t)r(t);else{const t=e.offset||0,i=e.length||n.length-t;let s=n;0===t&&i===n.length||(s=n.slice(t,i+t)),r(null,s)}}))}close(e=(()=>{})){if(!this.cache)return r((()=>e(new Error("CacheStore closed"))));this.cache=null,this.store.close(e)}destroy(e=(()=>{})){if(!this.cache)return r((()=>e(new Error("CacheStore closed"))));this.cache=null,this.store.destroy(e)}}},{lru:258,"queue-microtask":355}],124:[function(e,t,n){arguments[4][32][0].apply(n,arguments)},{dup:32}],125:[function(e,t,n){arguments[4][33][0].apply(n,arguments)},{"./_stream_readable":127,"./_stream_writable":129,_process:342,dup:33,inherits:249}],126:[function(e,t,n){arguments[4][34][0].apply(n,arguments)},{"./_stream_transform":128,dup:34,inherits:249}],127:[function(e,t,n){arguments[4][35][0].apply(n,arguments)},{"../errors":124,"./_stream_duplex":125,"./internal/streams/async_iterator":130,"./internal/streams/buffer_list":131,"./internal/streams/destroy":132,"./internal/streams/from":134,"./internal/streams/state":136,"./internal/streams/stream":137,_process:342,buffer:116,dup:35,events:196,inherits:249,"string_decoder/":481,util:73}],128:[function(e,t,n){arguments[4][36][0].apply(n,arguments)},{"../errors":124,"./_stream_duplex":125,dup:36,inherits:249}],129:[function(e,t,n){arguments[4][37][0].apply(n,arguments)},{"../errors":124,"./_stream_duplex":125,"./internal/streams/destroy":132,"./internal/streams/state":136,"./internal/streams/stream":137,_process:342,buffer:116,dup:37,inherits:249,"util-deprecate":500}],130:[function(e,t,n){arguments[4][38][0].apply(n,arguments)},{"./end-of-stream":133,_process:342,dup:38}],131:[function(e,t,n){arguments[4][39][0].apply(n,arguments)},{buffer:116,dup:39,util:73}],132:[function(e,t,n){arguments[4][40][0].apply(n,arguments)},{_process:342,dup:40}],133:[function(e,t,n){arguments[4][41][0].apply(n,arguments)},{"../../../errors":124,dup:41}],134:[function(e,t,n){arguments[4][42][0].apply(n,arguments)},{dup:42}],135:[function(e,t,n){arguments[4][43][0].apply(n,arguments)},{"../../../errors":124,"./end-of-stream":133,dup:43}],136:[function(e,t,n){arguments[4][44][0].apply(n,arguments)},{"../../../errors":124,dup:44}],137:[function(e,t,n){arguments[4][45][0].apply(n,arguments)},{dup:45,events:196}],138:[function(e,t,n){arguments[4][46][0].apply(n,arguments)},{"./lib/_stream_duplex.js":125,"./lib/_stream_passthrough.js":126,"./lib/_stream_readable.js":127,"./lib/_stream_transform.js":128,"./lib/_stream_writable.js":129,"./lib/internal/streams/end-of-stream.js":133,"./lib/internal/streams/pipeline.js":135,dup:46}],139:[function(e,t,n){const i=e("block-stream2"),r=e("readable-stream");class s extends r.Writable{constructor(e,t,n={}){if(super(n),!e||!e.put||!e.get)throw new Error("First argument must be an abstract-chunk-store compliant store");if(!(t=Number(t)))throw new Error("Second argument must be a chunk length");const r=void 0!==n.zeroPadding&&n.zeroPadding;this._blockstream=new i(t,{...n,zeroPadding:r}),this._outstandingPuts=0,this._storeMaxOutstandingPuts=n.storeMaxOutstandingPuts||16;let s=0;this._blockstream.on("data",(t=>{this.destroyed||(this._outstandingPuts+=1,this._outstandingPuts>=this._storeMaxOutstandingPuts&&this._blockstream.pause(),e.put(s,t,(e=>{if(e)return this.destroy(e);this._outstandingPuts-=1,this._outstandingPuts{this.destroy(e)}))}_write(e,t,n){this._blockstream.write(e,t,n)}_final(e){this._blockstream.end(),this._blockstream.once("end",(()=>{0===this._outstandingPuts?e(null):this._finalCb=e}))}destroy(e){this.destroyed||(this.destroyed=!0,e&&this.emit("error",e),this.emit("close"))}}t.exports=s},{"block-stream2":55,"readable-stream":138}],140:[function(e,t,n){var i=e("safe-buffer").Buffer,r=e("stream").Transform,s=e("string_decoder").StringDecoder;function o(e){r.call(this),this.hashMode="string"==typeof e,this.hashMode?this[e]=this._finalOrDigest:this.final=this._finalOrDigest,this._final&&(this.__final=this._final,this._final=null),this._decoder=null,this._encoding=null}e("inherits")(o,r),o.prototype.update=function(e,t,n){"string"==typeof e&&(e=i.from(e,t));var r=this._update(e);return this.hashMode?this:(n&&(r=this._toString(r,n)),r)},o.prototype.setAutoPadding=function(){},o.prototype.getAuthTag=function(){throw new Error("trying to get auth tag in unsupported state")},o.prototype.setAuthTag=function(){throw new Error("trying to set auth tag in unsupported state")},o.prototype.setAAD=function(){throw new Error("trying to set aad in unsupported state")},o.prototype._transform=function(e,t,n){var i;try{this.hashMode?this._update(e):this.push(this._update(e))}catch(e){i=e}finally{n(i)}},o.prototype._flush=function(e){var t;try{this.push(this.__final())}catch(e){t=e}e(t)},o.prototype._finalOrDigest=function(e){var t=this.__final()||i.alloc(0);return e&&(t=this._toString(t,e,!0)),t},o.prototype._toString=function(e,t,n){if(this._decoder||(this._decoder=new s(t),this._encoding=t),this._encoding!==t)throw new Error("can't switch encodings");var i=this._decoder.write(e);return n&&(i+=this._decoder.end()),i},t.exports=o},{inherits:249,"safe-buffer":386,stream:443,string_decoder:481}],141:[function(e,t,n){ +const n=e("lru"),r=e("queue-microtask");t.exports=class{constructor(e,t){if(this.store=e,this.chunkLength=e.chunkLength,this.inProgressGets=new Map,!this.store||!this.store.get||!this.store.put)throw new Error("First argument must be abstract-chunk-store compliant");this.cache=new n(t)}put(e,t,i=(()=>{})){if(!this.cache)return r((()=>i(new Error("CacheStore closed"))));this.cache.remove(e),this.store.put(e,t,i)}get(e,t,i=(()=>{})){if("function"==typeof t)return this.get(e,null,t);if(!this.cache)return r((()=>i(new Error("CacheStore closed"))));t||(t={});let n=this.cache.get(e);if(n){const e=t.offset||0,s=t.length||n.length-e;return 0===e&&s===n.length||(n=n.slice(e,s+e)),r((()=>i(null,n)))}let s=this.inProgressGets.get(e);const a=!!s;s||(s=[],this.inProgressGets.set(e,s)),s.push({opts:t,cb:i}),a||this.store.get(e,((t,i)=>{t||null==this.cache||this.cache.set(e,i);const n=this.inProgressGets.get(e);this.inProgressGets.delete(e);for(const{opts:e,cb:r}of n)if(t)r(t);else{const t=e.offset||0,n=e.length||i.length-t;let s=i;0===t&&n===i.length||(s=i.slice(t,n+t)),r(null,s)}}))}close(e=(()=>{})){if(!this.cache)return r((()=>e(new Error("CacheStore closed"))));this.cache=null,this.store.close(e)}destroy(e=(()=>{})){if(!this.cache)return r((()=>e(new Error("CacheStore closed"))));this.cache=null,this.store.destroy(e)}}},{lru:255,"queue-microtask":354}],118:[function(e,t,i){arguments[4][29][0].apply(i,arguments)},{dup:29}],119:[function(e,t,i){arguments[4][30][0].apply(i,arguments)},{"./_stream_readable":121,"./_stream_writable":123,_process:341,dup:30,inherits:246}],120:[function(e,t,i){arguments[4][31][0].apply(i,arguments)},{"./_stream_transform":122,dup:31,inherits:246}],121:[function(e,t,i){arguments[4][32][0].apply(i,arguments)},{"../errors":118,"./_stream_duplex":119,"./internal/streams/async_iterator":124,"./internal/streams/buffer_list":125,"./internal/streams/destroy":126,"./internal/streams/from":128,"./internal/streams/state":130,"./internal/streams/stream":131,_process:341,buffer:110,dup:32,events:193,inherits:246,"string_decoder/":472,util:67}],122:[function(e,t,i){arguments[4][33][0].apply(i,arguments)},{"../errors":118,"./_stream_duplex":119,dup:33,inherits:246}],123:[function(e,t,i){arguments[4][34][0].apply(i,arguments)},{"../errors":118,"./_stream_duplex":119,"./internal/streams/destroy":126,"./internal/streams/state":130,"./internal/streams/stream":131,_process:341,buffer:110,dup:34,inherits:246,"util-deprecate":485}],124:[function(e,t,i){arguments[4][35][0].apply(i,arguments)},{"./end-of-stream":127,_process:341,dup:35}],125:[function(e,t,i){arguments[4][36][0].apply(i,arguments)},{buffer:110,dup:36,util:67}],126:[function(e,t,i){arguments[4][37][0].apply(i,arguments)},{_process:341,dup:37}],127:[function(e,t,i){arguments[4][38][0].apply(i,arguments)},{"../../../errors":118,dup:38}],128:[function(e,t,i){arguments[4][39][0].apply(i,arguments)},{dup:39}],129:[function(e,t,i){arguments[4][40][0].apply(i,arguments)},{"../../../errors":118,"./end-of-stream":127,dup:40}],130:[function(e,t,i){arguments[4][41][0].apply(i,arguments)},{"../../../errors":118,dup:41}],131:[function(e,t,i){arguments[4][42][0].apply(i,arguments)},{dup:42,events:193}],132:[function(e,t,i){arguments[4][43][0].apply(i,arguments)},{"./lib/_stream_duplex.js":119,"./lib/_stream_passthrough.js":120,"./lib/_stream_readable.js":121,"./lib/_stream_transform.js":122,"./lib/_stream_writable.js":123,"./lib/internal/streams/end-of-stream.js":127,"./lib/internal/streams/pipeline.js":129,dup:43}],133:[function(e,t,i){const n=e("block-stream2"),r=e("readable-stream");class s extends r.Writable{constructor(e,t,i={}){if(super(i),!e||!e.put||!e.get)throw new Error("First argument must be an abstract-chunk-store compliant store");if(!(t=Number(t)))throw new Error("Second argument must be a chunk length");const r=void 0!==i.zeroPadding&&i.zeroPadding;this._blockstream=new n(t,{...i,zeroPadding:r}),this._outstandingPuts=0,this._storeMaxOutstandingPuts=i.storeMaxOutstandingPuts||16;let s=0;this._blockstream.on("data",(t=>{this.destroyed||(this._outstandingPuts+=1,this._outstandingPuts>=this._storeMaxOutstandingPuts&&this._blockstream.pause(),e.put(s,t,(e=>{if(e)return this.destroy(e);this._outstandingPuts-=1,this._outstandingPuts{this.destroy(e)}))}_write(e,t,i){this._blockstream.write(e,t,i)}_final(e){this._blockstream.end(),this._blockstream.once("end",(()=>{0===this._outstandingPuts?e(null):this._finalCb=e}))}destroy(e){this.destroyed||(this.destroyed=!0,e&&this.emit("error",e),this.emit("close"))}}t.exports=s},{"block-stream2":49,"readable-stream":132}],134:[function(e,t,i){var n=e("safe-buffer").Buffer,r=e("stream").Transform,s=e("string_decoder").StringDecoder;function a(e){r.call(this),this.hashMode="string"==typeof e,this.hashMode?this[e]=this._finalOrDigest:this.final=this._finalOrDigest,this._final&&(this.__final=this._final,this._final=null),this._decoder=null,this._encoding=null}e("inherits")(a,r),a.prototype.update=function(e,t,i){"string"==typeof e&&(e=n.from(e,t));var r=this._update(e);return this.hashMode?this:(i&&(r=this._toString(r,i)),r)},a.prototype.setAutoPadding=function(){},a.prototype.getAuthTag=function(){throw new Error("trying to get auth tag in unsupported state")},a.prototype.setAuthTag=function(){throw new Error("trying to set auth tag in unsupported state")},a.prototype.setAAD=function(){throw new Error("trying to set aad in unsupported state")},a.prototype._transform=function(e,t,i){var n;try{this.hashMode?this._update(e):this.push(this._update(e))}catch(e){n=e}finally{i(n)}},a.prototype._flush=function(e){var t;try{this.push(this.__final())}catch(e){t=e}e(t)},a.prototype._finalOrDigest=function(e){var t=this.__final()||n.alloc(0);return e&&(t=this._toString(t,e,!0)),t},a.prototype._toString=function(e,t,i){if(this._decoder||(this._decoder=new s(t),this._encoding=t),this._encoding!==t)throw new Error("can't switch encodings");var n=this._decoder.write(e);return i&&(n+=this._decoder.end()),n},t.exports=a},{inherits:246,"safe-buffer":383,stream:434,string_decoder:472}],135:[function(e,t,i){ /*! * clipboard.js v2.0.8 * https://clipboardjs.com/ * * Licensed MIT © Zeno Rocha */ -var i,r;i=this,r=function(){return function(){var e={134:function(e,t,n){"use strict";n.d(t,{default:function(){return y}});var i=n(279),r=n.n(i),s=n(370),o=n.n(s),a=n(817),c=n.n(a);function u(e){return(u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function l(e,t){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{};this.action=e.action,this.container=e.container,this.emitter=e.emitter,this.target=e.target,this.text=e.text,this.trigger=e.trigger,this.selectedText=""}},{key:"initSelection",value:function(){this.text?this.selectFake():this.target&&this.selectTarget()}},{key:"createFakeElement",value:function(){var e="rtl"===document.documentElement.getAttribute("dir");this.fakeElem=document.createElement("textarea"),this.fakeElem.style.fontSize="12pt",this.fakeElem.style.border="0",this.fakeElem.style.padding="0",this.fakeElem.style.margin="0",this.fakeElem.style.position="absolute",this.fakeElem.style[e?"right":"left"]="-9999px";var t=window.pageYOffset||document.documentElement.scrollTop;return this.fakeElem.style.top="".concat(t,"px"),this.fakeElem.setAttribute("readonly",""),this.fakeElem.value=this.text,this.fakeElem}},{key:"selectFake",value:function(){var e=this,t=this.createFakeElement();this.fakeHandlerCallback=function(){return e.removeFake()},this.fakeHandler=this.container.addEventListener("click",this.fakeHandlerCallback)||!0,this.container.appendChild(t),this.selectedText=c()(t),this.copyText(),this.removeFake()}},{key:"removeFake",value:function(){this.fakeHandler&&(this.container.removeEventListener("click",this.fakeHandlerCallback),this.fakeHandler=null,this.fakeHandlerCallback=null),this.fakeElem&&(this.container.removeChild(this.fakeElem),this.fakeElem=null)}},{key:"selectTarget",value:function(){this.selectedText=c()(this.target),this.copyText()}},{key:"copyText",value:function(){var e;try{e=document.execCommand(this.action)}catch(t){e=!1}this.handleResult(e)}},{key:"handleResult",value:function(e){this.emitter.emit(e?"success":"error",{action:this.action,text:this.selectedText,trigger:this.trigger,clearSelection:this.clearSelection.bind(this)})}},{key:"clearSelection",value:function(){this.trigger&&this.trigger.focus(),document.activeElement.blur(),window.getSelection().removeAllRanges()}},{key:"destroy",value:function(){this.removeFake()}},{key:"action",set:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"copy";if(this._action=e,"copy"!==this._action&&"cut"!==this._action)throw new Error('Invalid "action" value, use either "copy" or "cut"')},get:function(){return this._action}},{key:"target",set:function(e){if(void 0!==e){if(!e||"object"!==u(e)||1!==e.nodeType)throw new Error('Invalid "target" value, use a valid Element');if("copy"===this.action&&e.hasAttribute("disabled"))throw new Error('Invalid "target" attribute. Please use "readonly" instead of "disabled" attribute');if("cut"===this.action&&(e.hasAttribute("readonly")||e.hasAttribute("disabled")))throw new Error('Invalid "target" attribute. You can\'t cut text from elements with "readonly" or "disabled" attributes');this._target=e}},get:function(){return this._target}}])&&l(t.prototype,n),i&&l(t,i),e}();function f(e){return(f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function p(e,t){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:["copy","cut"],t="string"==typeof e?[e]:e,n=!!document.queryCommandSupported;return t.forEach((function(e){n=n&&!!document.queryCommandSupported(e)})),n}}],(n=[{key:"resolveOptions",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.action="function"==typeof e.action?e.action:this.defaultAction,this.target="function"==typeof e.target?e.target:this.defaultTarget,this.text="function"==typeof e.text?e.text:this.defaultText,this.container="object"===f(e.container)?e.container:document.body}},{key:"listenClick",value:function(e){var t=this;this.listener=o()(e,"click",(function(e){return t.onClick(e)}))}},{key:"onClick",value:function(e){var t=e.delegateTarget||e.currentTarget;this.clipboardAction&&(this.clipboardAction=null),this.clipboardAction=new d({action:this.action(t),target:this.target(t),text:this.text(t),container:this.container,trigger:t,emitter:this})}},{key:"defaultAction",value:function(e){return v("action",e)}},{key:"defaultTarget",value:function(e){var t=v("target",e);if(t)return document.querySelector(t)}},{key:"defaultText",value:function(e){return v("text",e)}},{key:"destroy",value:function(){this.listener.destroy(),this.clipboardAction&&(this.clipboardAction.destroy(),this.clipboardAction=null)}}])&&p(t.prototype,n),i&&p(t,i),s}(r())},828:function(e){if("undefined"!=typeof Element&&!Element.prototype.matches){var t=Element.prototype;t.matches=t.matchesSelector||t.mozMatchesSelector||t.msMatchesSelector||t.oMatchesSelector||t.webkitMatchesSelector}e.exports=function(e,t){for(;e&&9!==e.nodeType;){if("function"==typeof e.matches&&e.matches(t))return e;e=e.parentNode}}},438:function(e,t,n){var i=n(828);function r(e,t,n,i,r){var o=s.apply(this,arguments);return e.addEventListener(n,o,r),{destroy:function(){e.removeEventListener(n,o,r)}}}function s(e,t,n,r){return function(n){n.delegateTarget=i(n.target,t),n.delegateTarget&&r.call(e,n)}}e.exports=function(e,t,n,i,s){return"function"==typeof e.addEventListener?r.apply(null,arguments):"function"==typeof n?r.bind(null,document).apply(null,arguments):("string"==typeof e&&(e=document.querySelectorAll(e)),Array.prototype.map.call(e,(function(e){return r(e,t,n,i,s)})))}},879:function(e,t){t.node=function(e){return void 0!==e&&e instanceof HTMLElement&&1===e.nodeType},t.nodeList=function(e){var n=Object.prototype.toString.call(e);return void 0!==e&&("[object NodeList]"===n||"[object HTMLCollection]"===n)&&"length"in e&&(0===e.length||t.node(e[0]))},t.string=function(e){return"string"==typeof e||e instanceof String},t.fn=function(e){return"[object Function]"===Object.prototype.toString.call(e)}},370:function(e,t,n){var i=n(879),r=n(438);e.exports=function(e,t,n){if(!e&&!t&&!n)throw new Error("Missing required arguments");if(!i.string(t))throw new TypeError("Second argument must be a String");if(!i.fn(n))throw new TypeError("Third argument must be a Function");if(i.node(e))return function(e,t,n){return e.addEventListener(t,n),{destroy:function(){e.removeEventListener(t,n)}}}(e,t,n);if(i.nodeList(e))return function(e,t,n){return Array.prototype.forEach.call(e,(function(e){e.addEventListener(t,n)})),{destroy:function(){Array.prototype.forEach.call(e,(function(e){e.removeEventListener(t,n)}))}}}(e,t,n);if(i.string(e))return function(e,t,n){return r(document.body,e,t,n)}(e,t,n);throw new TypeError("First argument must be a String, HTMLElement, HTMLCollection, or NodeList")}},817:function(e){e.exports=function(e){var t;if("SELECT"===e.nodeName)e.focus(),t=e.value;else if("INPUT"===e.nodeName||"TEXTAREA"===e.nodeName){var n=e.hasAttribute("readonly");n||e.setAttribute("readonly",""),e.select(),e.setSelectionRange(0,e.value.length),n||e.removeAttribute("readonly"),t=e.value}else{e.hasAttribute("contenteditable")&&e.focus();var i=window.getSelection(),r=document.createRange();r.selectNodeContents(e),i.removeAllRanges(),i.addRange(r),t=i.toString()}return t}},279:function(e){function t(){}t.prototype={on:function(e,t,n){var i=this.e||(this.e={});return(i[e]||(i[e]=[])).push({fn:t,ctx:n}),this},once:function(e,t,n){var i=this;function r(){i.off(e,r),t.apply(n,arguments)}return r._=t,this.on(e,r,n)},emit:function(e){for(var t=[].slice.call(arguments,1),n=((this.e||(this.e={}))[e]||[]).slice(),i=0,r=n.length;in)?t=("rmd160"===e?new c:u(e)).update(t).digest():t.lengtha?t=e(t):t.length0&&void 0!==arguments[0]?arguments[0]:{};this.action=e.action,this.container=e.container,this.emitter=e.emitter,this.target=e.target,this.text=e.text,this.trigger=e.trigger,this.selectedText=""}},{key:"initSelection",value:function(){this.text?this.selectFake():this.target&&this.selectTarget()}},{key:"createFakeElement",value:function(){var e="rtl"===document.documentElement.getAttribute("dir");this.fakeElem=document.createElement("textarea"),this.fakeElem.style.fontSize="12pt",this.fakeElem.style.border="0",this.fakeElem.style.padding="0",this.fakeElem.style.margin="0",this.fakeElem.style.position="absolute",this.fakeElem.style[e?"right":"left"]="-9999px";var t=window.pageYOffset||document.documentElement.scrollTop;return this.fakeElem.style.top="".concat(t,"px"),this.fakeElem.setAttribute("readonly",""),this.fakeElem.value=this.text,this.fakeElem}},{key:"selectFake",value:function(){var e=this,t=this.createFakeElement();this.fakeHandlerCallback=function(){return e.removeFake()},this.fakeHandler=this.container.addEventListener("click",this.fakeHandlerCallback)||!0,this.container.appendChild(t),this.selectedText=c()(t),this.copyText(),this.removeFake()}},{key:"removeFake",value:function(){this.fakeHandler&&(this.container.removeEventListener("click",this.fakeHandlerCallback),this.fakeHandler=null,this.fakeHandlerCallback=null),this.fakeElem&&(this.container.removeChild(this.fakeElem),this.fakeElem=null)}},{key:"selectTarget",value:function(){this.selectedText=c()(this.target),this.copyText()}},{key:"copyText",value:function(){var e;try{e=document.execCommand(this.action)}catch(t){e=!1}this.handleResult(e)}},{key:"handleResult",value:function(e){this.emitter.emit(e?"success":"error",{action:this.action,text:this.selectedText,trigger:this.trigger,clearSelection:this.clearSelection.bind(this)})}},{key:"clearSelection",value:function(){this.trigger&&this.trigger.focus(),document.activeElement.blur(),window.getSelection().removeAllRanges()}},{key:"destroy",value:function(){this.removeFake()}},{key:"action",set:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"copy";if(this._action=e,"copy"!==this._action&&"cut"!==this._action)throw new Error('Invalid "action" value, use either "copy" or "cut"')},get:function(){return this._action}},{key:"target",set:function(e){if(void 0!==e){if(!e||"object"!==l(e)||1!==e.nodeType)throw new Error('Invalid "target" value, use a valid Element');if("copy"===this.action&&e.hasAttribute("disabled"))throw new Error('Invalid "target" attribute. Please use "readonly" instead of "disabled" attribute');if("cut"===this.action&&(e.hasAttribute("readonly")||e.hasAttribute("disabled")))throw new Error('Invalid "target" attribute. You can\'t cut text from elements with "readonly" or "disabled" attributes');this._target=e}},get:function(){return this._target}}],i&&u(t.prototype,i),n&&u(t,n),e}(),d=p;function f(e){return f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},f(e)}function h(e,t){for(var i=0;i0&&void 0!==arguments[0]?arguments[0]:{};this.action="function"==typeof e.action?e.action:this.defaultAction,this.target="function"==typeof e.target?e.target:this.defaultTarget,this.text="function"==typeof e.text?e.text:this.defaultText,this.container="object"===f(e.container)?e.container:document.body}},{key:"listenClick",value:function(e){var t=this;this.listener=a()(e,"click",(function(e){return t.onClick(e)}))}},{key:"onClick",value:function(e){var t=e.delegateTarget||e.currentTarget;this.clipboardAction&&(this.clipboardAction=null),this.clipboardAction=new d({action:this.action(t),target:this.target(t),text:this.text(t),container:this.container,trigger:t,emitter:this})}},{key:"defaultAction",value:function(e){return y("action",e)}},{key:"defaultTarget",value:function(e){var t=y("target",e);if(t)return document.querySelector(t)}},{key:"defaultText",value:function(e){return y("text",e)}},{key:"destroy",value:function(){this.listener.destroy(),this.clipboardAction&&(this.clipboardAction.destroy(),this.clipboardAction=null)}}],n=[{key:"isSupported",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:["copy","cut"],t="string"==typeof e?[e]:e,i=!!document.queryCommandSupported;return t.forEach((function(e){i=i&&!!document.queryCommandSupported(e)})),i}}],i&&h(t.prototype,i),n&&h(t,n),s}(r()),x=_},828:function(e){if("undefined"!=typeof Element&&!Element.prototype.matches){var t=Element.prototype;t.matches=t.matchesSelector||t.mozMatchesSelector||t.msMatchesSelector||t.oMatchesSelector||t.webkitMatchesSelector}e.exports=function(e,t){for(;e&&9!==e.nodeType;){if("function"==typeof e.matches&&e.matches(t))return e;e=e.parentNode}}},438:function(e,t,i){var n=i(828);function r(e,t,i,n,r){var a=s.apply(this,arguments);return e.addEventListener(i,a,r),{destroy:function(){e.removeEventListener(i,a,r)}}}function s(e,t,i,r){return function(i){i.delegateTarget=n(i.target,t),i.delegateTarget&&r.call(e,i)}}e.exports=function(e,t,i,n,s){return"function"==typeof e.addEventListener?r.apply(null,arguments):"function"==typeof i?r.bind(null,document).apply(null,arguments):("string"==typeof e&&(e=document.querySelectorAll(e)),Array.prototype.map.call(e,(function(e){return r(e,t,i,n,s)})))}},879:function(e,t){t.node=function(e){return void 0!==e&&e instanceof HTMLElement&&1===e.nodeType},t.nodeList=function(e){var i=Object.prototype.toString.call(e);return void 0!==e&&("[object NodeList]"===i||"[object HTMLCollection]"===i)&&"length"in e&&(0===e.length||t.node(e[0]))},t.string=function(e){return"string"==typeof e||e instanceof String},t.fn=function(e){return"[object Function]"===Object.prototype.toString.call(e)}},370:function(e,t,i){var n=i(879),r=i(438);e.exports=function(e,t,i){if(!e&&!t&&!i)throw new Error("Missing required arguments");if(!n.string(t))throw new TypeError("Second argument must be a String");if(!n.fn(i))throw new TypeError("Third argument must be a Function");if(n.node(e))return function(e,t,i){return e.addEventListener(t,i),{destroy:function(){e.removeEventListener(t,i)}}}(e,t,i);if(n.nodeList(e))return function(e,t,i){return Array.prototype.forEach.call(e,(function(e){e.addEventListener(t,i)})),{destroy:function(){Array.prototype.forEach.call(e,(function(e){e.removeEventListener(t,i)}))}}}(e,t,i);if(n.string(e))return function(e,t,i){return r(document.body,e,t,i)}(e,t,i);throw new TypeError("First argument must be a String, HTMLElement, HTMLCollection, or NodeList")}},817:function(e){e.exports=function(e){var t;if("SELECT"===e.nodeName)e.focus(),t=e.value;else if("INPUT"===e.nodeName||"TEXTAREA"===e.nodeName){var i=e.hasAttribute("readonly");i||e.setAttribute("readonly",""),e.select(),e.setSelectionRange(0,e.value.length),i||e.removeAttribute("readonly"),t=e.value}else{e.hasAttribute("contenteditable")&&e.focus();var n=window.getSelection(),r=document.createRange();r.selectNodeContents(e),n.removeAllRanges(),n.addRange(r),t=n.toString()}return t}},279:function(e){function t(){}t.prototype={on:function(e,t,i){var n=this.e||(this.e={});return(n[e]||(n[e]=[])).push({fn:t,ctx:i}),this},once:function(e,t,i){var n=this;function r(){n.off(e,r),t.apply(i,arguments)}return r._=t,this.on(e,r,i)},emit:function(e){for(var t=[].slice.call(arguments,1),i=((this.e||(this.e={}))[e]||[]).slice(),n=0,r=i.length;ni)?t=("rmd160"===e?new c:l(e)).update(t).digest():t.lengtho?t=e(t):t.length */ -const i=e("bencode"),r=e("block-stream2"),s=e("piece-length"),o=e("path"),a=e("filestream/read"),c=e("is-file"),u=e("junk"),l=e("multistream"),d=e("once"),f=e("run-parallel"),p=e("queue-microtask"),h=e("simple-sha1"),m=e("readable-stream"),b=e("./get-files");function g(e,t,i){var r;if(r=e,"undefined"!=typeof FileList&&r instanceof FileList&&(e=Array.from(e)),Array.isArray(e)||(e=[e]),0===e.length)throw new Error("invalid input type");e.forEach((e=>{if(null==e)throw new Error(`invalid input type: ${e}`)})),1!==(e=e.map((e=>_(e)&&"string"==typeof e.path&&"function"==typeof b?e.path:e))).length||"string"==typeof e[0]||e[0].name||(e[0].name=t.name);let s=null;e.forEach(((t,n)=>{if("string"==typeof t)return;let i=t.fullPath||t.name;i||(i=`Unknown File ${n+1}`,t.unknownName=!0),t.path=i.split("/"),t.path[0]||t.path.shift(),t.path.length<2?s=null:0===n&&e.length>1?s=t.path[0]:t.path[0]!==s&&(s=null)}));(void 0===t.filterJunkFiles||t.filterJunkFiles)&&(e=e.filter((e=>"string"==typeof e||!v(e.path)))),s&&e.forEach((e=>{const t=(n.isBuffer(e)||w(e))&&!e.path;"string"==typeof e||t||e.path.shift()})),!t.name&&s&&(t.name=s),t.name||e.some((e=>"string"==typeof e?(t.name=o.basename(e),!0):!e.unknownName&&(t.name=e.path[e.path.length-1],!0))),t.name||(t.name=`Unnamed Torrent ${Date.now()}`);const u=e.reduce(((e,t)=>e+Number("string"==typeof t)),0);let l=1===e.length;if(1===e.length&&"string"==typeof e[0]){if("function"!=typeof b)throw new Error("filesystem paths do not work in the browser");c(e[0],((e,t)=>{if(e)return i(e);l=t,d()}))}else p(d);function d(){f(e.map((e=>t=>{const i={};if(_(e))i.getStream=function(e){return()=>new a(e)}(e),i.length=e.size;else if(n.isBuffer(e))i.getStream=(r=e,()=>{const e=new m.PassThrough;return e.end(r),e}),i.length=e.length;else{if(!w(e)){if("string"==typeof e){if("function"!=typeof b)throw new Error("filesystem paths do not work in the browser");return void b(e,u>1||l,t)}throw new Error("invalid input type")}i.getStream=function(e,t){return()=>{const n=new m.Transform;return n._transform=function(e,n,i){t.length+=e.length,this.push(e),i()},e.pipe(n),n}}(e,i),i.length=0}var r;i.path=e.path,t(null,i)})),((e,t)=>{if(e)return i(e);t=t.flat(),i(null,t,l)}))}}function v(e){const t=e[e.length-1];return"."===t[0]&&u.is(t)}function y(e,t){return e+t.length}function _(e){return"undefined"!=typeof Blob&&e instanceof Blob}function w(e){return"object"==typeof e&&null!=e&&"function"==typeof e.pipe}t.exports=function(e,o,a){"function"==typeof o&&([o,a]=[a,o]),g(e,o=o?Object.assign({},o):{},((e,c,u)=>{if(e)return a(e);o.singleFileTorrent=u,function(e,o,a){let c=o.announceList;c||("string"==typeof o.announce?c=[[o.announce]]:Array.isArray(o.announce)&&(c=o.announce.map((e=>[e]))));c||(c=[]);globalThis.WEBTORRENT_ANNOUNCE&&("string"==typeof globalThis.WEBTORRENT_ANNOUNCE?c.push([[globalThis.WEBTORRENT_ANNOUNCE]]):Array.isArray(globalThis.WEBTORRENT_ANNOUNCE)&&(c=c.concat(globalThis.WEBTORRENT_ANNOUNCE.map((e=>[e])))));void 0===o.announce&&void 0===o.announceList&&(c=c.concat(t.exports.announceList));"string"==typeof o.urlList&&(o.urlList=[o.urlList]);const u={info:{name:o.name},"creation date":Math.ceil((Number(o.creationDate)||Date.now())/1e3),encoding:"UTF-8"};0!==c.length&&(u.announce=c[0][0],u["announce-list"]=c);void 0!==o.comment&&(u.comment=o.comment);void 0!==o.createdBy&&(u["created by"]=o.createdBy);void 0!==o.private&&(u.info.private=Number(o.private));void 0!==o.info&&Object.assign(u.info,o.info);void 0!==o.sslCert&&(u.info["ssl-cert"]=o.sslCert);void 0!==o.urlList&&(u["url-list"]=o.urlList);const f=e.reduce(y,0),p=o.pieceLength||s(f);u.info["piece length"]=p,function(e,t,i,s,o){o=d(o);const a=[];let c=0,u=0;const f=e.map((e=>e.getStream));let p=0,m=0,b=!1;const g=new l(f),v=new r(t,{zeroPadding:!1});function y(e){c+=e.length;const t=m;h(e,(n=>{a[t]=n,p-=1,p<5&&v.resume(),u+=e.length,s.onProgress&&s.onProgress(u,i),k()})),p+=1,p>=5&&v.pause(),m+=1}function _(){b=!0,k()}function w(e){x(),o(e)}function x(){g.removeListener("error",w),v.removeListener("data",y),v.removeListener("end",_),v.removeListener("error",w)}function k(){b&&0===p&&(x(),o(null,n.from(a.join(""),"hex"),c))}g.on("error",w),g.pipe(v).on("data",y).on("end",_).on("error",w)}(e,p,f,o,((t,n,r)=>{if(t)return a(t);u.info.pieces=n,e.forEach((e=>{delete e.getStream})),o.singleFileTorrent?u.info.length=r:u.info.files=e,a(null,i.encode(u))}))}(c,o,a)}))},t.exports.parseInput=function(e,t,n){"function"==typeof t&&([t,n]=[n,t]),g(e,t=t?Object.assign({},t):{},n)},t.exports.announceList=[["udp://tracker.leechers-paradise.org:6969"],["udp://tracker.coppersurfer.tk:6969"],["udp://tracker.opentrackr.org:1337"],["udp://explodie.org:6969"],["udp://tracker.empire-js.us:1337"],["wss://tracker.btorrent.xyz"],["wss://tracker.openwebtorrent.com"]],t.exports.isJunkPath=v}).call(this)}).call(this,e("buffer").Buffer)},{"./get-files":73,bencode:23,"block-stream2":55,buffer:116,"filestream/read":215,"is-file":73,junk:253,multistream:310,once:327,path:334,"piece-length":341,"queue-microtask":355,"readable-stream":164,"run-parallel":384,"simple-sha1":417}],150:[function(e,t,n){arguments[4][32][0].apply(n,arguments)},{dup:32}],151:[function(e,t,n){arguments[4][33][0].apply(n,arguments)},{"./_stream_readable":153,"./_stream_writable":155,_process:342,dup:33,inherits:249}],152:[function(e,t,n){arguments[4][34][0].apply(n,arguments)},{"./_stream_transform":154,dup:34,inherits:249}],153:[function(e,t,n){arguments[4][35][0].apply(n,arguments)},{"../errors":150,"./_stream_duplex":151,"./internal/streams/async_iterator":156,"./internal/streams/buffer_list":157,"./internal/streams/destroy":158,"./internal/streams/from":160,"./internal/streams/state":162,"./internal/streams/stream":163,_process:342,buffer:116,dup:35,events:196,inherits:249,"string_decoder/":481,util:73}],154:[function(e,t,n){arguments[4][36][0].apply(n,arguments)},{"../errors":150,"./_stream_duplex":151,dup:36,inherits:249}],155:[function(e,t,n){arguments[4][37][0].apply(n,arguments)},{"../errors":150,"./_stream_duplex":151,"./internal/streams/destroy":158,"./internal/streams/state":162,"./internal/streams/stream":163,_process:342,buffer:116,dup:37,inherits:249,"util-deprecate":500}],156:[function(e,t,n){arguments[4][38][0].apply(n,arguments)},{"./end-of-stream":159,_process:342,dup:38}],157:[function(e,t,n){arguments[4][39][0].apply(n,arguments)},{buffer:116,dup:39,util:73}],158:[function(e,t,n){arguments[4][40][0].apply(n,arguments)},{_process:342,dup:40}],159:[function(e,t,n){arguments[4][41][0].apply(n,arguments)},{"../../../errors":150,dup:41}],160:[function(e,t,n){arguments[4][42][0].apply(n,arguments)},{dup:42}],161:[function(e,t,n){arguments[4][43][0].apply(n,arguments)},{"../../../errors":150,"./end-of-stream":159,dup:43}],162:[function(e,t,n){arguments[4][44][0].apply(n,arguments)},{"../../../errors":150,dup:44}],163:[function(e,t,n){arguments[4][45][0].apply(n,arguments)},{dup:45,events:196}],164:[function(e,t,n){arguments[4][46][0].apply(n,arguments)},{"./lib/_stream_duplex.js":151,"./lib/_stream_passthrough.js":152,"./lib/_stream_readable.js":153,"./lib/_stream_transform.js":154,"./lib/_stream_writable.js":155,"./lib/internal/streams/end-of-stream.js":159,"./lib/internal/streams/pipeline.js":161,dup:46}],165:[function(e,t,n){"use strict";n.randomBytes=n.rng=n.pseudoRandomBytes=n.prng=e("randombytes"),n.createHash=n.Hash=e("create-hash"),n.createHmac=n.Hmac=e("create-hmac");var i=e("browserify-sign/algos"),r=Object.keys(i),s=["sha1","sha224","sha256","sha384","sha512","md5","rmd160"].concat(r);n.getHashes=function(){return s};var o=e("pbkdf2");n.pbkdf2=o.pbkdf2,n.pbkdf2Sync=o.pbkdf2Sync;var a=e("browserify-cipher");n.Cipher=a.Cipher,n.createCipher=a.createCipher,n.Cipheriv=a.Cipheriv,n.createCipheriv=a.createCipheriv,n.Decipher=a.Decipher,n.createDecipher=a.createDecipher,n.Decipheriv=a.Decipheriv,n.createDecipheriv=a.createDecipheriv,n.getCiphers=a.getCiphers,n.listCiphers=a.listCiphers;var c=e("diffie-hellman");n.DiffieHellmanGroup=c.DiffieHellmanGroup,n.createDiffieHellmanGroup=c.createDiffieHellmanGroup,n.getDiffieHellman=c.getDiffieHellman,n.createDiffieHellman=c.createDiffieHellman,n.DiffieHellman=c.DiffieHellman;var u=e("browserify-sign");n.createSign=u.createSign,n.Sign=u.Sign,n.createVerify=u.createVerify,n.Verify=u.Verify,n.createECDH=e("create-ecdh");var l=e("public-encrypt");n.publicEncrypt=l.publicEncrypt,n.privateEncrypt=l.privateEncrypt,n.publicDecrypt=l.publicDecrypt,n.privateDecrypt=l.privateDecrypt;var d=e("randomfill");n.randomFill=d.randomFill,n.randomFillSync=d.randomFillSync,n.createCredentials=function(){throw new Error(["sorry, createCredentials is not implemented yet","we accept pull requests","https://github.com/crypto-browserify/crypto-browserify"].join("\n"))},n.constants={DH_CHECK_P_NOT_SAFE_PRIME:2,DH_CHECK_P_NOT_PRIME:1,DH_UNABLE_TO_CHECK_GENERATOR:4,DH_NOT_SUITABLE_GENERATOR:8,NPN_ENABLED:1,ALPN_ENABLED:1,RSA_PKCS1_PADDING:1,RSA_SSLV23_PADDING:2,RSA_NO_PADDING:3,RSA_PKCS1_OAEP_PADDING:4,RSA_X931_PADDING:5,RSA_PKCS1_PSS_PADDING:6,POINT_CONVERSION_COMPRESSED:2,POINT_CONVERSION_UNCOMPRESSED:4,POINT_CONVERSION_HYBRID:6}},{"browserify-cipher":91,"browserify-sign":98,"browserify-sign/algos":95,"create-ecdh":143,"create-hash":145,"create-hmac":147,"diffie-hellman":172,pbkdf2:335,"public-encrypt":343,randombytes:358,randomfill:359}],166:[function(e,t,n){"use strict";n.utils=e("./des/utils"),n.Cipher=e("./des/cipher"),n.DES=e("./des/des"),n.CBC=e("./des/cbc"),n.EDE=e("./des/ede")},{"./des/cbc":167,"./des/cipher":168,"./des/des":169,"./des/ede":170,"./des/utils":171}],167:[function(e,t,n){"use strict";var i=e("minimalistic-assert"),r=e("inherits"),s={};function o(e){i.equal(e.length,8,"Invalid IV length"),this.iv=new Array(8);for(var t=0;t0;i--)t+=this._buffer(e,t),n+=this._flushBuffer(r,n);return t+=this._buffer(e,t),r},r.prototype.final=function(e){var t,n;return e&&(t=this.update(e)),n="encrypt"===this.type?this._finalEncrypt():this._finalDecrypt(),t?t.concat(n):n},r.prototype._pad=function(e,t){if(0===t)return!1;for(;t>>1];n=s.r28shl(n,a),r=s.r28shl(r,a),s.pc2(n,r,e.keys,o)}},c.prototype._update=function(e,t,n,i){var r=this._desState,o=s.readUInt32BE(e,t),a=s.readUInt32BE(e,t+4);s.ip(o,a,r.tmp,0),o=r.tmp[0],a=r.tmp[1],"encrypt"===this.type?this._encrypt(r,o,a,r.tmp,0):this._decrypt(r,o,a,r.tmp,0),o=r.tmp[0],a=r.tmp[1],s.writeUInt32BE(n,o,i),s.writeUInt32BE(n,a,i+4)},c.prototype._pad=function(e,t){for(var n=e.length-t,i=t;i>>0,o=f}s.rip(a,o,i,r)},c.prototype._decrypt=function(e,t,n,i,r){for(var o=n,a=t,c=e.keys.length-2;c>=0;c-=2){var u=e.keys[c],l=e.keys[c+1];s.expand(o,e.tmp,0),u^=e.tmp[0],l^=e.tmp[1];var d=s.substitute(u,l),f=o;o=(a^s.permute(d))>>>0,a=f}s.rip(o,a,i,r)}},{"./cipher":168,"./utils":171,inherits:249,"minimalistic-assert":287}],170:[function(e,t,n){"use strict";var i=e("minimalistic-assert"),r=e("inherits"),s=e("./cipher"),o=e("./des");function a(e,t){i.equal(t.length,24,"Invalid key length");var n=t.slice(0,8),r=t.slice(8,16),s=t.slice(16,24);this.ciphers="encrypt"===e?[o.create({type:"encrypt",key:n}),o.create({type:"decrypt",key:r}),o.create({type:"encrypt",key:s})]:[o.create({type:"decrypt",key:s}),o.create({type:"encrypt",key:r}),o.create({type:"decrypt",key:n})]}function c(e){s.call(this,e);var t=new a(this.type,this.options.key);this._edeState=t}r(c,s),t.exports=c,c.create=function(e){return new c(e)},c.prototype._update=function(e,t,n,i){var r=this._edeState;r.ciphers[0]._update(e,t,n,i),r.ciphers[1]._update(n,i,n,i),r.ciphers[2]._update(n,i,n,i)},c.prototype._pad=o.prototype._pad,c.prototype._unpad=o.prototype._unpad},{"./cipher":168,"./des":169,inherits:249,"minimalistic-assert":287}],171:[function(e,t,n){"use strict";n.readUInt32BE=function(e,t){return(e[0+t]<<24|e[1+t]<<16|e[2+t]<<8|e[3+t])>>>0},n.writeUInt32BE=function(e,t,n){e[0+n]=t>>>24,e[1+n]=t>>>16&255,e[2+n]=t>>>8&255,e[3+n]=255&t},n.ip=function(e,t,n,i){for(var r=0,s=0,o=6;o>=0;o-=2){for(var a=0;a<=24;a+=8)r<<=1,r|=t>>>a+o&1;for(a=0;a<=24;a+=8)r<<=1,r|=e>>>a+o&1}for(o=6;o>=0;o-=2){for(a=1;a<=25;a+=8)s<<=1,s|=t>>>a+o&1;for(a=1;a<=25;a+=8)s<<=1,s|=e>>>a+o&1}n[i+0]=r>>>0,n[i+1]=s>>>0},n.rip=function(e,t,n,i){for(var r=0,s=0,o=0;o<4;o++)for(var a=24;a>=0;a-=8)r<<=1,r|=t>>>a+o&1,r<<=1,r|=e>>>a+o&1;for(o=4;o<8;o++)for(a=24;a>=0;a-=8)s<<=1,s|=t>>>a+o&1,s<<=1,s|=e>>>a+o&1;n[i+0]=r>>>0,n[i+1]=s>>>0},n.pc1=function(e,t,n,i){for(var r=0,s=0,o=7;o>=5;o--){for(var a=0;a<=24;a+=8)r<<=1,r|=t>>a+o&1;for(a=0;a<=24;a+=8)r<<=1,r|=e>>a+o&1}for(a=0;a<=24;a+=8)r<<=1,r|=t>>a+o&1;for(o=1;o<=3;o++){for(a=0;a<=24;a+=8)s<<=1,s|=t>>a+o&1;for(a=0;a<=24;a+=8)s<<=1,s|=e>>a+o&1}for(a=0;a<=24;a+=8)s<<=1,s|=e>>a+o&1;n[i+0]=r>>>0,n[i+1]=s>>>0},n.r28shl=function(e,t){return e<>>28-t};var i=[14,11,17,4,27,23,25,0,13,22,7,18,5,9,16,24,2,20,12,21,1,8,15,26,15,4,25,19,9,1,26,16,5,11,23,8,12,7,17,0,22,3,10,14,6,20,27,24];n.pc2=function(e,t,n,r){for(var s=0,o=0,a=i.length>>>1,c=0;c>>i[c]&1;for(c=a;c>>i[c]&1;n[r+0]=s>>>0,n[r+1]=o>>>0},n.expand=function(e,t,n){var i=0,r=0;i=(1&e)<<5|e>>>27;for(var s=23;s>=15;s-=4)i<<=6,i|=e>>>s&63;for(s=11;s>=3;s-=4)r|=e>>>s&63,r<<=6;r|=(31&e)<<1|e>>>31,t[n+0]=i>>>0,t[n+1]=r>>>0};var r=[14,0,4,15,13,7,1,4,2,14,15,2,11,13,8,1,3,10,10,6,6,12,12,11,5,9,9,5,0,3,7,8,4,15,1,12,14,8,8,2,13,4,6,9,2,1,11,7,15,5,12,11,9,3,7,14,3,10,10,0,5,6,0,13,15,3,1,13,8,4,14,7,6,15,11,2,3,8,4,14,9,12,7,0,2,1,13,10,12,6,0,9,5,11,10,5,0,13,14,8,7,10,11,1,10,3,4,15,13,4,1,2,5,11,8,6,12,7,6,12,9,0,3,5,2,14,15,9,10,13,0,7,9,0,14,9,6,3,3,4,15,6,5,10,1,2,13,8,12,5,7,14,11,12,4,11,2,15,8,1,13,1,6,10,4,13,9,0,8,6,15,9,3,8,0,7,11,4,1,15,2,14,12,3,5,11,10,5,14,2,7,12,7,13,13,8,14,11,3,5,0,6,6,15,9,0,10,3,1,4,2,7,8,2,5,12,11,1,12,10,4,14,15,9,10,3,6,15,9,0,0,6,12,10,11,1,7,13,13,8,15,9,1,4,3,5,14,11,5,12,2,7,8,2,4,14,2,14,12,11,4,2,1,12,7,4,10,7,11,13,6,1,8,5,5,0,3,15,15,10,13,3,0,9,14,8,9,6,4,11,2,8,1,12,11,7,10,1,13,14,7,2,8,13,15,6,9,15,12,0,5,9,6,10,3,4,0,5,14,3,12,10,1,15,10,4,15,2,9,7,2,12,6,9,8,5,0,6,13,1,3,13,4,14,14,0,7,11,5,3,11,8,9,4,14,3,15,2,5,12,2,9,8,5,12,15,3,10,7,11,0,14,4,1,10,7,1,6,13,0,11,8,6,13,4,13,11,0,2,11,14,7,15,4,0,9,8,1,13,10,3,14,12,3,9,5,7,12,5,2,10,15,6,8,1,6,1,6,4,11,11,13,13,8,12,1,3,4,7,10,14,7,10,9,15,5,6,0,8,15,0,14,5,2,9,3,2,12,13,1,2,15,8,13,4,8,6,10,15,3,11,7,1,4,10,12,9,5,3,6,14,11,5,0,0,14,12,9,7,2,7,2,11,1,4,14,1,7,9,4,12,10,14,8,2,13,0,15,6,12,10,9,13,0,15,3,3,5,5,6,8,11];n.substitute=function(e,t){for(var n=0,i=0;i<4;i++){n<<=4,n|=r[64*i+(e>>>18-6*i&63)]}for(i=0;i<4;i++){n<<=4,n|=r[256+64*i+(t>>>18-6*i&63)]}return n>>>0};var s=[16,25,12,11,3,20,4,15,31,17,9,6,27,14,1,22,30,24,8,18,0,5,29,23,13,19,2,26,10,21,28,7];n.permute=function(e){for(var t=0,n=0;n>>s[n]&1;return t>>>0},n.padSplit=function(e,t,n){for(var i=e.toString(2);i.lengthe;)n.ishrn(1);if(n.isEven()&&n.iadd(a),n.testn(1)||n.iadd(c),t.cmp(c)){if(!t.cmp(u))for(;n.mod(l).cmp(d);)n.iadd(p)}else for(;n.mod(s).cmp(f);)n.iadd(p);if(b(h=n.shrn(1))&&b(n)&&g(h)&&g(n)&&o.test(h)&&o.test(n))return n}}},{"bn.js":176,"miller-rabin":282,randombytes:358}],175:[function(e,t,n){t.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"}}},{}],176:[function(e,t,n){arguments[4][18][0].apply(n,arguments)},{buffer:73,dup:18}],177:[function(e,t,n){"use strict";var i=n;i.version=e("../package.json").version,i.utils=e("./elliptic/utils"),i.rand=e("brorand"),i.curve=e("./elliptic/curve"),i.curves=e("./elliptic/curves"),i.ec=e("./elliptic/ec"),i.eddsa=e("./elliptic/eddsa")},{"../package.json":193,"./elliptic/curve":180,"./elliptic/curves":183,"./elliptic/ec":184,"./elliptic/eddsa":187,"./elliptic/utils":191,brorand:72}],178:[function(e,t,n){"use strict";var i=e("bn.js"),r=e("../utils"),s=r.getNAF,o=r.getJSF,a=r.assert;function c(e,t){this.type=e,this.p=new i(t.p,16),this.red=t.prime?i.red(t.prime):i.mont(this.p),this.zero=new i(0).toRed(this.red),this.one=new i(1).toRed(this.red),this.two=new i(2).toRed(this.red),this.n=t.n&&new i(t.n,16),this.g=t.g&&this.pointFromJSON(t.g,t.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var n=this.n&&this.p.div(this.n);!n||n.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}function u(e,t){this.curve=e,this.type=t,this.precomputed=null}t.exports=c,c.prototype.point=function(){throw new Error("Not implemented")},c.prototype.validate=function(){throw new Error("Not implemented")},c.prototype._fixedNafMul=function(e,t){a(e.precomputed);var n=e._getDoubles(),i=s(t,1,this._bitLength),r=(1<=o;l--)c=(c<<1)+i[l];u.push(c)}for(var d=this.jpoint(null,null,null),f=this.jpoint(null,null,null),p=r;p>0;p--){for(o=0;o=0;u--){for(var l=0;u>=0&&0===o[u];u--)l++;if(u>=0&&l++,c=c.dblp(l),u<0)break;var d=o[u];a(0!==d),c="affine"===e.type?d>0?c.mixedAdd(r[d-1>>1]):c.mixedAdd(r[-d-1>>1].neg()):d>0?c.add(r[d-1>>1]):c.add(r[-d-1>>1].neg())}return"affine"===e.type?c.toP():c},c.prototype._wnafMulAdd=function(e,t,n,i,r){var a,c,u,l=this._wnafT1,d=this._wnafT2,f=this._wnafT3,p=0;for(a=0;a=1;a-=2){var m=a-1,b=a;if(1===l[m]&&1===l[b]){var g=[t[m],null,null,t[b]];0===t[m].y.cmp(t[b].y)?(g[1]=t[m].add(t[b]),g[2]=t[m].toJ().mixedAdd(t[b].neg())):0===t[m].y.cmp(t[b].y.redNeg())?(g[1]=t[m].toJ().mixedAdd(t[b]),g[2]=t[m].add(t[b].neg())):(g[1]=t[m].toJ().mixedAdd(t[b]),g[2]=t[m].toJ().mixedAdd(t[b].neg()));var v=[-3,-1,-5,-7,0,7,5,1,3],y=o(n[m],n[b]);for(p=Math.max(y[0].length,p),f[m]=new Array(p),f[b]=new Array(p),c=0;c=0;a--){for(var E=0;a>=0;){var S=!0;for(c=0;c=0&&E++,x=x.dblp(E),a<0)break;for(c=0;c0?u=d[c][M-1>>1]:M<0&&(u=d[c][-M-1>>1].neg()),x="affine"===u.type?x.mixedAdd(u):x.add(u))}}for(a=0;a=Math.ceil((e.bitLength()+1)/t.step)},u.prototype._getDoubles=function(e,t){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var n=[this],i=this,r=0;r":""},u.prototype.isInfinity=function(){return 0===this.x.cmpn(0)&&(0===this.y.cmp(this.z)||this.zOne&&0===this.y.cmp(this.curve.c))},u.prototype._extDbl=function(){var e=this.x.redSqr(),t=this.y.redSqr(),n=this.z.redSqr();n=n.redIAdd(n);var i=this.curve._mulA(e),r=this.x.redAdd(this.y).redSqr().redISub(e).redISub(t),s=i.redAdd(t),o=s.redSub(n),a=i.redSub(t),c=r.redMul(o),u=s.redMul(a),l=r.redMul(a),d=o.redMul(s);return this.curve.point(c,u,d,l)},u.prototype._projDbl=function(){var e,t,n,i,r,s,o=this.x.redAdd(this.y).redSqr(),a=this.x.redSqr(),c=this.y.redSqr();if(this.curve.twisted){var u=(i=this.curve._mulA(a)).redAdd(c);this.zOne?(e=o.redSub(a).redSub(c).redMul(u.redSub(this.curve.two)),t=u.redMul(i.redSub(c)),n=u.redSqr().redSub(u).redSub(u)):(r=this.z.redSqr(),s=u.redSub(r).redISub(r),e=o.redSub(a).redISub(c).redMul(s),t=u.redMul(i.redSub(c)),n=u.redMul(s))}else i=a.redAdd(c),r=this.curve._mulC(this.z).redSqr(),s=i.redSub(r).redSub(r),e=this.curve._mulC(o.redISub(i)).redMul(s),t=this.curve._mulC(i).redMul(a.redISub(c)),n=i.redMul(s);return this.curve.point(e,t,n)},u.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},u.prototype._extAdd=function(e){var t=this.y.redSub(this.x).redMul(e.y.redSub(e.x)),n=this.y.redAdd(this.x).redMul(e.y.redAdd(e.x)),i=this.t.redMul(this.curve.dd).redMul(e.t),r=this.z.redMul(e.z.redAdd(e.z)),s=n.redSub(t),o=r.redSub(i),a=r.redAdd(i),c=n.redAdd(t),u=s.redMul(o),l=a.redMul(c),d=s.redMul(c),f=o.redMul(a);return this.curve.point(u,l,f,d)},u.prototype._projAdd=function(e){var t,n,i=this.z.redMul(e.z),r=i.redSqr(),s=this.x.redMul(e.x),o=this.y.redMul(e.y),a=this.curve.d.redMul(s).redMul(o),c=r.redSub(a),u=r.redAdd(a),l=this.x.redAdd(this.y).redMul(e.x.redAdd(e.y)).redISub(s).redISub(o),d=i.redMul(c).redMul(l);return this.curve.twisted?(t=i.redMul(u).redMul(o.redSub(this.curve._mulA(s))),n=c.redMul(u)):(t=i.redMul(u).redMul(o.redSub(s)),n=this.curve._mulC(c).redMul(u)),this.curve.point(d,t,n)},u.prototype.add=function(e){return this.isInfinity()?e:e.isInfinity()?this:this.curve.extended?this._extAdd(e):this._projAdd(e)},u.prototype.mul=function(e){return this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve._wnafMul(this,e)},u.prototype.mulAdd=function(e,t,n){return this.curve._wnafMulAdd(1,[this,t],[e,n],2,!1)},u.prototype.jmulAdd=function(e,t,n){return this.curve._wnafMulAdd(1,[this,t],[e,n],2,!0)},u.prototype.normalize=function(){if(this.zOne)return this;var e=this.z.redInvm();return this.x=this.x.redMul(e),this.y=this.y.redMul(e),this.t&&(this.t=this.t.redMul(e)),this.z=this.curve.one,this.zOne=!0,this},u.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},u.prototype.getX=function(){return this.normalize(),this.x.fromRed()},u.prototype.getY=function(){return this.normalize(),this.y.fromRed()},u.prototype.eq=function(e){return this===e||0===this.getX().cmp(e.getX())&&0===this.getY().cmp(e.getY())},u.prototype.eqXToP=function(e){var t=e.toRed(this.curve.red).redMul(this.z);if(0===this.x.cmp(t))return!0;for(var n=e.clone(),i=this.curve.redN.redMul(this.z);;){if(n.iadd(this.curve.n),n.cmp(this.curve.p)>=0)return!1;if(t.redIAdd(i),0===this.x.cmp(t))return!0}},u.prototype.toP=u.prototype.normalize,u.prototype.mixedAdd=u.prototype.add},{"../utils":191,"./base":178,"bn.js":192,inherits:249}],180:[function(e,t,n){"use strict";var i=n;i.base=e("./base"),i.short=e("./short"),i.mont=e("./mont"),i.edwards=e("./edwards")},{"./base":178,"./edwards":179,"./mont":181,"./short":182}],181:[function(e,t,n){"use strict";var i=e("bn.js"),r=e("inherits"),s=e("./base"),o=e("../utils");function a(e){s.call(this,"mont",e),this.a=new i(e.a,16).toRed(this.red),this.b=new i(e.b,16).toRed(this.red),this.i4=new i(4).toRed(this.red).redInvm(),this.two=new i(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}function c(e,t,n){s.BasePoint.call(this,e,"projective"),null===t&&null===n?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new i(t,16),this.z=new i(n,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}r(a,s),t.exports=a,a.prototype.validate=function(e){var t=e.normalize().x,n=t.redSqr(),i=n.redMul(t).redAdd(n.redMul(this.a)).redAdd(t);return 0===i.redSqrt().redSqr().cmp(i)},r(c,s.BasePoint),a.prototype.decodePoint=function(e,t){return this.point(o.toArray(e,t),1)},a.prototype.point=function(e,t){return new c(this,e,t)},a.prototype.pointFromJSON=function(e){return c.fromJSON(this,e)},c.prototype.precompute=function(){},c.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},c.fromJSON=function(e,t){return new c(e,t[0],t[1]||e.one)},c.prototype.inspect=function(){return this.isInfinity()?"":""},c.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},c.prototype.dbl=function(){var e=this.x.redAdd(this.z).redSqr(),t=this.x.redSub(this.z).redSqr(),n=e.redSub(t),i=e.redMul(t),r=n.redMul(t.redAdd(this.curve.a24.redMul(n)));return this.curve.point(i,r)},c.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},c.prototype.diffAdd=function(e,t){var n=this.x.redAdd(this.z),i=this.x.redSub(this.z),r=e.x.redAdd(e.z),s=e.x.redSub(e.z).redMul(n),o=r.redMul(i),a=t.z.redMul(s.redAdd(o).redSqr()),c=t.x.redMul(s.redISub(o).redSqr());return this.curve.point(a,c)},c.prototype.mul=function(e){for(var t=e.clone(),n=this,i=this.curve.point(null,null),r=[];0!==t.cmpn(0);t.iushrn(1))r.push(t.andln(1));for(var s=r.length-1;s>=0;s--)0===r[s]?(n=n.diffAdd(i,this),i=i.dbl()):(i=n.diffAdd(i,this),n=n.dbl());return i},c.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},c.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")},c.prototype.eq=function(e){return 0===this.getX().cmp(e.getX())},c.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},c.prototype.getX=function(){return this.normalize(),this.x.fromRed()}},{"../utils":191,"./base":178,"bn.js":192,inherits:249}],182:[function(e,t,n){"use strict";var i=e("../utils"),r=e("bn.js"),s=e("inherits"),o=e("./base"),a=i.assert;function c(e){o.call(this,"short",e),this.a=new r(e.a,16).toRed(this.red),this.b=new r(e.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=0===this.a.fromRed().cmpn(0),this.threeA=0===this.a.fromRed().sub(this.p).cmpn(-3),this.endo=this._getEndomorphism(e),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}function u(e,t,n,i){o.BasePoint.call(this,e,"affine"),null===t&&null===n?(this.x=null,this.y=null,this.inf=!0):(this.x=new r(t,16),this.y=new r(n,16),i&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.inf=!1)}function l(e,t,n,i){o.BasePoint.call(this,e,"jacobian"),null===t&&null===n&&null===i?(this.x=this.curve.one,this.y=this.curve.one,this.z=new r(0)):(this.x=new r(t,16),this.y=new r(n,16),this.z=new r(i,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}s(c,o),t.exports=c,c.prototype._getEndomorphism=function(e){if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3)){var t,n;if(e.beta)t=new r(e.beta,16).toRed(this.red);else{var i=this._getEndoRoots(this.p);t=(t=i[0].cmp(i[1])<0?i[0]:i[1]).toRed(this.red)}if(e.lambda)n=new r(e.lambda,16);else{var s=this._getEndoRoots(this.n);0===this.g.mul(s[0]).x.cmp(this.g.x.redMul(t))?n=s[0]:(n=s[1],a(0===this.g.mul(n).x.cmp(this.g.x.redMul(t))))}return{beta:t,lambda:n,basis:e.basis?e.basis.map((function(e){return{a:new r(e.a,16),b:new r(e.b,16)}})):this._getEndoBasis(n)}}},c.prototype._getEndoRoots=function(e){var t=e===this.p?this.red:r.mont(e),n=new r(2).toRed(t).redInvm(),i=n.redNeg(),s=new r(3).toRed(t).redNeg().redSqrt().redMul(n);return[i.redAdd(s).fromRed(),i.redSub(s).fromRed()]},c.prototype._getEndoBasis=function(e){for(var t,n,i,s,o,a,c,u,l,d=this.n.ushrn(Math.floor(this.n.bitLength()/2)),f=e,p=this.n.clone(),h=new r(1),m=new r(0),b=new r(0),g=new r(1),v=0;0!==f.cmpn(0);){var y=p.div(f);u=p.sub(y.mul(f)),l=b.sub(y.mul(h));var _=g.sub(y.mul(m));if(!i&&u.cmp(d)<0)t=c.neg(),n=h,i=u.neg(),s=l;else if(i&&2==++v)break;c=u,p=f,f=u,b=h,h=l,g=m,m=_}o=u.neg(),a=l;var w=i.sqr().add(s.sqr());return o.sqr().add(a.sqr()).cmp(w)>=0&&(o=t,a=n),i.negative&&(i=i.neg(),s=s.neg()),o.negative&&(o=o.neg(),a=a.neg()),[{a:i,b:s},{a:o,b:a}]},c.prototype._endoSplit=function(e){var t=this.endo.basis,n=t[0],i=t[1],r=i.b.mul(e).divRound(this.n),s=n.b.neg().mul(e).divRound(this.n),o=r.mul(n.a),a=s.mul(i.a),c=r.mul(n.b),u=s.mul(i.b);return{k1:e.sub(o).sub(a),k2:c.add(u).neg()}},c.prototype.pointFromX=function(e,t){(e=new r(e,16)).red||(e=e.toRed(this.red));var n=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),i=n.redSqrt();if(0!==i.redSqr().redSub(n).cmp(this.zero))throw new Error("invalid point");var s=i.fromRed().isOdd();return(t&&!s||!t&&s)&&(i=i.redNeg()),this.point(e,i)},c.prototype.validate=function(e){if(e.inf)return!0;var t=e.x,n=e.y,i=this.a.redMul(t),r=t.redSqr().redMul(t).redIAdd(i).redIAdd(this.b);return 0===n.redSqr().redISub(r).cmpn(0)},c.prototype._endoWnafMulAdd=function(e,t,n){for(var i=this._endoWnafT1,r=this._endoWnafT2,s=0;s":""},u.prototype.isInfinity=function(){return this.inf},u.prototype.add=function(e){if(this.inf)return e;if(e.inf)return this;if(this.eq(e))return this.dbl();if(this.neg().eq(e))return this.curve.point(null,null);if(0===this.x.cmp(e.x))return this.curve.point(null,null);var t=this.y.redSub(e.y);0!==t.cmpn(0)&&(t=t.redMul(this.x.redSub(e.x).redInvm()));var n=t.redSqr().redISub(this.x).redISub(e.x),i=t.redMul(this.x.redSub(n)).redISub(this.y);return this.curve.point(n,i)},u.prototype.dbl=function(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(0===e.cmpn(0))return this.curve.point(null,null);var t=this.curve.a,n=this.x.redSqr(),i=e.redInvm(),r=n.redAdd(n).redIAdd(n).redIAdd(t).redMul(i),s=r.redSqr().redISub(this.x.redAdd(this.x)),o=r.redMul(this.x.redSub(s)).redISub(this.y);return this.curve.point(s,o)},u.prototype.getX=function(){return this.x.fromRed()},u.prototype.getY=function(){return this.y.fromRed()},u.prototype.mul=function(e){return e=new r(e,16),this.isInfinity()?this:this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)},u.prototype.mulAdd=function(e,t,n){var i=[this,t],r=[e,n];return this.curve.endo?this.curve._endoWnafMulAdd(i,r):this.curve._wnafMulAdd(1,i,r,2)},u.prototype.jmulAdd=function(e,t,n){var i=[this,t],r=[e,n];return this.curve.endo?this.curve._endoWnafMulAdd(i,r,!0):this.curve._wnafMulAdd(1,i,r,2,!0)},u.prototype.eq=function(e){return this===e||this.inf===e.inf&&(this.inf||0===this.x.cmp(e.x)&&0===this.y.cmp(e.y))},u.prototype.neg=function(e){if(this.inf)return this;var t=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var n=this.precomputed,i=function(e){return e.neg()};t.precomputed={naf:n.naf&&{wnd:n.naf.wnd,points:n.naf.points.map(i)},doubles:n.doubles&&{step:n.doubles.step,points:n.doubles.points.map(i)}}}return t},u.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},s(l,o.BasePoint),c.prototype.jpoint=function(e,t,n){return new l(this,e,t,n)},l.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),t=e.redSqr(),n=this.x.redMul(t),i=this.y.redMul(t).redMul(e);return this.curve.point(n,i)},l.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},l.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var t=e.z.redSqr(),n=this.z.redSqr(),i=this.x.redMul(t),r=e.x.redMul(n),s=this.y.redMul(t.redMul(e.z)),o=e.y.redMul(n.redMul(this.z)),a=i.redSub(r),c=s.redSub(o);if(0===a.cmpn(0))return 0!==c.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var u=a.redSqr(),l=u.redMul(a),d=i.redMul(u),f=c.redSqr().redIAdd(l).redISub(d).redISub(d),p=c.redMul(d.redISub(f)).redISub(s.redMul(l)),h=this.z.redMul(e.z).redMul(a);return this.curve.jpoint(f,p,h)},l.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var t=this.z.redSqr(),n=this.x,i=e.x.redMul(t),r=this.y,s=e.y.redMul(t).redMul(this.z),o=n.redSub(i),a=r.redSub(s);if(0===o.cmpn(0))return 0!==a.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var c=o.redSqr(),u=c.redMul(o),l=n.redMul(c),d=a.redSqr().redIAdd(u).redISub(l).redISub(l),f=a.redMul(l.redISub(d)).redISub(r.redMul(u)),p=this.z.redMul(o);return this.curve.jpoint(d,f,p)},l.prototype.dblp=function(e){if(0===e)return this;if(this.isInfinity())return this;if(!e)return this.dbl();var t;if(this.curve.zeroA||this.curve.threeA){var n=this;for(t=0;t=0)return!1;if(n.redIAdd(r),0===this.x.cmp(n))return!0}},l.prototype.inspect=function(){return this.isInfinity()?"":""},l.prototype.isInfinity=function(){return 0===this.z.cmpn(0)}},{"../utils":191,"./base":178,"bn.js":192,inherits:249}],183:[function(e,t,n){"use strict";var i,r=n,s=e("hash.js"),o=e("./curve"),a=e("./utils").assert;function c(e){"short"===e.type?this.curve=new o.short(e):"edwards"===e.type?this.curve=new o.edwards(e):this.curve=new o.mont(e),this.g=this.curve.g,this.n=this.curve.n,this.hash=e.hash,a(this.g.validate(),"Invalid curve"),a(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function u(e,t){Object.defineProperty(r,e,{configurable:!0,enumerable:!0,get:function(){var n=new c(t);return Object.defineProperty(r,e,{configurable:!0,enumerable:!0,value:n}),n}})}r.PresetCurve=c,u("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:s.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),u("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:s.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),u("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:s.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),u("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:s.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),u("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:s.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),u("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:s.sha256,gRed:!1,g:["9"]}),u("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:s.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{i=e("./precomputed/secp256k1")}catch(e){i=void 0}u("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:s.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",i]})},{"./curve":180,"./precomputed/secp256k1":190,"./utils":191,"hash.js":233}],184:[function(e,t,n){"use strict";var i=e("bn.js"),r=e("hmac-drbg"),s=e("../utils"),o=e("../curves"),a=e("brorand"),c=s.assert,u=e("./key"),l=e("./signature");function d(e){if(!(this instanceof d))return new d(e);"string"==typeof e&&(c(Object.prototype.hasOwnProperty.call(o,e),"Unknown curve "+e),e=o[e]),e instanceof o.PresetCurve&&(e={curve:e}),this.curve=e.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=e.curve.g,this.g.precompute(e.curve.n.bitLength()+1),this.hash=e.hash||e.curve.hash}t.exports=d,d.prototype.keyPair=function(e){return new u(this,e)},d.prototype.keyFromPrivate=function(e,t){return u.fromPrivate(this,e,t)},d.prototype.keyFromPublic=function(e,t){return u.fromPublic(this,e,t)},d.prototype.genKeyPair=function(e){e||(e={});for(var t=new r({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||a(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),n=this.n.byteLength(),s=this.n.sub(new i(2));;){var o=new i(t.generate(n));if(!(o.cmp(s)>0))return o.iaddn(1),this.keyFromPrivate(o)}},d.prototype._truncateToN=function(e,t){var n=8*e.byteLength()-this.n.bitLength();return n>0&&(e=e.ushrn(n)),!t&&e.cmp(this.n)>=0?e.sub(this.n):e},d.prototype.sign=function(e,t,n,s){"object"==typeof n&&(s=n,n=null),s||(s={}),t=this.keyFromPrivate(t,n),e=this._truncateToN(new i(e,16));for(var o=this.n.byteLength(),a=t.getPrivate().toArray("be",o),c=e.toArray("be",o),u=new r({hash:this.hash,entropy:a,nonce:c,pers:s.pers,persEnc:s.persEnc||"utf8"}),d=this.n.sub(new i(1)),f=0;;f++){var p=s.k?s.k(f):new i(u.generate(this.n.byteLength()));if(!((p=this._truncateToN(p,!0)).cmpn(1)<=0||p.cmp(d)>=0)){var h=this.g.mul(p);if(!h.isInfinity()){var m=h.getX(),b=m.umod(this.n);if(0!==b.cmpn(0)){var g=p.invm(this.n).mul(b.mul(t.getPrivate()).iadd(e));if(0!==(g=g.umod(this.n)).cmpn(0)){var v=(h.getY().isOdd()?1:0)|(0!==m.cmp(b)?2:0);return s.canonical&&g.cmp(this.nh)>0&&(g=this.n.sub(g),v^=1),new l({r:b,s:g,recoveryParam:v})}}}}}},d.prototype.verify=function(e,t,n,r){e=this._truncateToN(new i(e,16)),n=this.keyFromPublic(n,r);var s=(t=new l(t,"hex")).r,o=t.s;if(s.cmpn(1)<0||s.cmp(this.n)>=0)return!1;if(o.cmpn(1)<0||o.cmp(this.n)>=0)return!1;var a,c=o.invm(this.n),u=c.mul(e).umod(this.n),d=c.mul(s).umod(this.n);return this.curve._maxwellTrick?!(a=this.g.jmulAdd(u,n.getPublic(),d)).isInfinity()&&a.eqXToP(s):!(a=this.g.mulAdd(u,n.getPublic(),d)).isInfinity()&&0===a.getX().umod(this.n).cmp(s)},d.prototype.recoverPubKey=function(e,t,n,r){c((3&n)===n,"The recovery param is more than two bits"),t=new l(t,r);var s=this.n,o=new i(e),a=t.r,u=t.s,d=1&n,f=n>>1;if(a.cmp(this.curve.p.umod(this.curve.n))>=0&&f)throw new Error("Unable to find sencond key candinate");a=f?this.curve.pointFromX(a.add(this.curve.n),d):this.curve.pointFromX(a,d);var p=t.r.invm(s),h=s.sub(o).mul(p).umod(s),m=u.mul(p).umod(s);return this.g.mulAdd(h,a,m)},d.prototype.getKeyRecoveryParam=function(e,t,n,i){if(null!==(t=new l(t,i)).recoveryParam)return t.recoveryParam;for(var r=0;r<4;r++){var s;try{s=this.recoverPubKey(e,t,r)}catch(e){continue}if(s.eq(n))return r}throw new Error("Unable to find valid recovery factor")}},{"../curves":183,"../utils":191,"./key":185,"./signature":186,"bn.js":192,brorand:72,"hmac-drbg":245}],185:[function(e,t,n){"use strict";var i=e("bn.js"),r=e("../utils").assert;function s(e,t){this.ec=e,this.priv=null,this.pub=null,t.priv&&this._importPrivate(t.priv,t.privEnc),t.pub&&this._importPublic(t.pub,t.pubEnc)}t.exports=s,s.fromPublic=function(e,t,n){return t instanceof s?t:new s(e,{pub:t,pubEnc:n})},s.fromPrivate=function(e,t,n){return t instanceof s?t:new s(e,{priv:t,privEnc:n})},s.prototype.validate=function(){var e=this.getPublic();return e.isInfinity()?{result:!1,reason:"Invalid public key"}:e.validate()?e.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}},s.prototype.getPublic=function(e,t){return"string"==typeof e&&(t=e,e=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),t?this.pub.encode(t,e):this.pub},s.prototype.getPrivate=function(e){return"hex"===e?this.priv.toString(16,2):this.priv},s.prototype._importPrivate=function(e,t){this.priv=new i(e,t||16),this.priv=this.priv.umod(this.ec.curve.n)},s.prototype._importPublic=function(e,t){if(e.x||e.y)return"mont"===this.ec.curve.type?r(e.x,"Need x coordinate"):"short"!==this.ec.curve.type&&"edwards"!==this.ec.curve.type||r(e.x&&e.y,"Need both x and y coordinate"),void(this.pub=this.ec.curve.point(e.x,e.y));this.pub=this.ec.curve.decodePoint(e,t)},s.prototype.derive=function(e){return e.validate()||r(e.validate(),"public point not validated"),e.mul(this.priv).getX()},s.prototype.sign=function(e,t,n){return this.ec.sign(e,this,t,n)},s.prototype.verify=function(e,t){return this.ec.verify(e,t,this)},s.prototype.inspect=function(){return""}},{"../utils":191,"bn.js":192}],186:[function(e,t,n){"use strict";var i=e("bn.js"),r=e("../utils"),s=r.assert;function o(e,t){if(e instanceof o)return e;this._importDER(e,t)||(s(e.r&&e.s,"Signature without r or s"),this.r=new i(e.r,16),this.s=new i(e.s,16),void 0===e.recoveryParam?this.recoveryParam=null:this.recoveryParam=e.recoveryParam)}function a(){this.place=0}function c(e,t){var n=e[t.place++];if(!(128&n))return n;var i=15&n;if(0===i||i>4)return!1;for(var r=0,s=0,o=t.place;s>>=0;return!(r<=127)&&(t.place=o,r)}function u(e){for(var t=0,n=e.length-1;!e[t]&&!(128&e[t+1])&&t>>3);for(e.push(128|n);--n;)e.push(t>>>(n<<3)&255);e.push(t)}}t.exports=o,o.prototype._importDER=function(e,t){e=r.toArray(e,t);var n=new a;if(48!==e[n.place++])return!1;var s=c(e,n);if(!1===s)return!1;if(s+n.place!==e.length)return!1;if(2!==e[n.place++])return!1;var o=c(e,n);if(!1===o)return!1;var u=e.slice(n.place,o+n.place);if(n.place+=o,2!==e[n.place++])return!1;var l=c(e,n);if(!1===l)return!1;if(e.length!==l+n.place)return!1;var d=e.slice(n.place,l+n.place);if(0===u[0]){if(!(128&u[1]))return!1;u=u.slice(1)}if(0===d[0]){if(!(128&d[1]))return!1;d=d.slice(1)}return this.r=new i(u),this.s=new i(d),this.recoveryParam=null,!0},o.prototype.toDER=function(e){var t=this.r.toArray(),n=this.s.toArray();for(128&t[0]&&(t=[0].concat(t)),128&n[0]&&(n=[0].concat(n)),t=u(t),n=u(n);!(n[0]||128&n[1]);)n=n.slice(1);var i=[2];l(i,t.length),(i=i.concat(t)).push(2),l(i,n.length);var s=i.concat(n),o=[48];return l(o,s.length),o=o.concat(s),r.encode(o,e)}},{"../utils":191,"bn.js":192}],187:[function(e,t,n){"use strict";var i=e("hash.js"),r=e("../curves"),s=e("../utils"),o=s.assert,a=s.parseBytes,c=e("./key"),u=e("./signature");function l(e){if(o("ed25519"===e,"only tested with ed25519 so far"),!(this instanceof l))return new l(e);e=r[e].curve,this.curve=e,this.g=e.g,this.g.precompute(e.n.bitLength()+1),this.pointClass=e.point().constructor,this.encodingLength=Math.ceil(e.n.bitLength()/8),this.hash=i.sha512}t.exports=l,l.prototype.sign=function(e,t){e=a(e);var n=this.keyFromSecret(t),i=this.hashInt(n.messagePrefix(),e),r=this.g.mul(i),s=this.encodePoint(r),o=this.hashInt(s,n.pubBytes(),e).mul(n.priv()),c=i.add(o).umod(this.curve.n);return this.makeSignature({R:r,S:c,Rencoded:s})},l.prototype.verify=function(e,t,n){e=a(e),t=this.makeSignature(t);var i=this.keyFromPublic(n),r=this.hashInt(t.Rencoded(),i.pubBytes(),e),s=this.g.mul(t.S());return t.R().add(i.pub().mul(r)).eq(s)},l.prototype.hashInt=function(){for(var e=this.hash(),t=0;t(r>>1)-1?(r>>1)-c:c,s.isubn(a)):a=0,i[o]=a,s.iushrn(1)}return i},i.getJSF=function(e,t){var n=[[],[]];e=e.clone(),t=t.clone();for(var i,r=0,s=0;e.cmpn(-r)>0||t.cmpn(-s)>0;){var o,a,c=e.andln(3)+r&3,u=t.andln(3)+s&3;3===c&&(c=-1),3===u&&(u=-1),o=0==(1&c)?0:3!==(i=e.andln(7)+r&7)&&5!==i||2!==u?c:-c,n[0].push(o),a=0==(1&u)?0:3!==(i=t.andln(7)+s&7)&&5!==i||2!==c?u:-u,n[1].push(a),2*r===o+1&&(r=1-r),2*s===a+1&&(s=1-s),e.iushrn(1),t.iushrn(1)}return n},i.cachedProperty=function(e,t,n){var i="_"+t;e.prototype[t]=function(){return void 0!==this[i]?this[i]:this[i]=n.call(this)}},i.parseBytes=function(e){return"string"==typeof e?i.toArray(e,"hex"):e},i.intFromLE=function(e){return new r(e,"hex","le")}},{"bn.js":192,"minimalistic-assert":287,"minimalistic-crypto-utils":288}],192:[function(e,t,n){arguments[4][18][0].apply(n,arguments)},{buffer:73,dup:18}],193:[function(e,t,n){t.exports={name:"elliptic",version:"6.5.4",description:"EC cryptography",main:"lib/elliptic.js",files:["lib"],scripts:{lint:"eslint lib test","lint:fix":"npm run lint -- --fix",unit:"istanbul test _mocha --reporter=spec test/index.js",test:"npm run lint && npm run unit",version:"grunt dist && git add dist/"},repository:{type:"git",url:"git@github.com:indutny/elliptic"},keywords:["EC","Elliptic","curve","Cryptography"],author:"Fedor Indutny ",license:"MIT",bugs:{url:"https://github.com/indutny/elliptic/issues"},homepage:"https://github.com/indutny/elliptic",devDependencies:{brfs:"^2.0.2",coveralls:"^3.1.0",eslint:"^7.6.0",grunt:"^1.2.1","grunt-browserify":"^5.3.0","grunt-cli":"^1.3.2","grunt-contrib-connect":"^3.0.0","grunt-contrib-copy":"^1.0.0","grunt-contrib-uglify":"^5.0.0","grunt-mocha-istanbul":"^5.0.2","grunt-saucelabs":"^9.0.1",istanbul:"^0.4.5",mocha:"^8.0.1"},dependencies:{"bn.js":"^4.11.9",brorand:"^1.1.0","hash.js":"^1.0.0","hmac-drbg":"^1.0.1",inherits:"^2.0.4","minimalistic-assert":"^1.0.1","minimalistic-crypto-utils":"^1.0.1"}}},{}],194:[function(e,t,n){(function(n){(function(){var i=e("once"),r=function(){},s=function(e,t,o){if("function"==typeof t)return s(e,null,t);t||(t={}),o=i(o||r);var a=e._writableState,c=e._readableState,u=t.readable||!1!==t.readable&&e.readable,l=t.writable||!1!==t.writable&&e.writable,d=!1,f=function(){e.writable||p()},p=function(){l=!1,u||o.call(e)},h=function(){u=!1,l||o.call(e)},m=function(t){o.call(e,t?new Error("exited with error code: "+t):null)},b=function(t){o.call(e,t)},g=function(){n.nextTick(v)},v=function(){if(!d)return(!u||c&&c.ended&&!c.destroyed)&&(!l||a&&a.ended&&!a.destroyed)?void 0:o.call(e,new Error("premature close"))},y=function(){e.req.on("finish",p)};return!function(e){return e.setHeader&&"function"==typeof e.abort}(e)?l&&!a&&(e.on("end",f),e.on("close",f)):(e.on("complete",p),e.on("abort",g),e.req?y():e.on("request",y)),function(e){return e.stdio&&Array.isArray(e.stdio)&&3===e.stdio.length}(e)&&e.on("exit",m),e.on("end",h),e.on("finish",p),!1!==t.error&&e.on("error",b),e.on("close",g),function(){d=!0,e.removeListener("complete",p),e.removeListener("abort",g),e.removeListener("request",y),e.req&&e.req.removeListener("finish",p),e.removeListener("end",f),e.removeListener("close",f),e.removeListener("finish",p),e.removeListener("exit",m),e.removeListener("end",h),e.removeListener("error",b),e.removeListener("close",g)}};t.exports=s}).call(this)}).call(this,e("_process"))},{_process:342,once:327}],195:[function(e,t,n){"use strict";function i(e,t){for(const n in t)Object.defineProperty(e,n,{value:t[n],enumerable:!0,configurable:!0});return e}t.exports=function(e,t,n){if(!e||"string"==typeof e)throw new TypeError("Please pass an Error to err-code");n||(n={}),"object"==typeof t&&(n=t,t=""),t&&(n.code=t);try{return i(e,n)}catch(t){n.message=e.message,n.stack=e.stack;const r=function(){};r.prototype=Object.create(Object.getPrototypeOf(e));return i(new r,n)}}},{}],196:[function(e,t,n){"use strict";var i,r="object"==typeof Reflect?Reflect:null,s=r&&"function"==typeof r.apply?r.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)};i=r&&"function"==typeof r.ownKeys?r.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var o=Number.isNaN||function(e){return e!=e};function a(){a.init.call(this)}t.exports=a,t.exports.once=function(e,t){return new Promise((function(n,i){function r(n){e.removeListener(t,s),i(n)}function s(){"function"==typeof e.removeListener&&e.removeListener("error",r),n([].slice.call(arguments))}g(e,t,s,{once:!0}),"error"!==t&&function(e,t,n){"function"==typeof e.on&&g(e,"error",t,n)}(e,r,{once:!0})}))},a.EventEmitter=a,a.prototype._events=void 0,a.prototype._eventsCount=0,a.prototype._maxListeners=void 0;var c=10;function u(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function l(e){return void 0===e._maxListeners?a.defaultMaxListeners:e._maxListeners}function d(e,t,n,i){var r,s,o,a;if(u(n),void 0===(s=e._events)?(s=e._events=Object.create(null),e._eventsCount=0):(void 0!==s.newListener&&(e.emit("newListener",t,n.listener?n.listener:n),s=e._events),o=s[t]),void 0===o)o=s[t]=n,++e._eventsCount;else if("function"==typeof o?o=s[t]=i?[n,o]:[o,n]:i?o.unshift(n):o.push(n),(r=l(e))>0&&o.length>r&&!o.warned){o.warned=!0;var c=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");c.name="MaxListenersExceededWarning",c.emitter=e,c.type=t,c.count=o.length,a=c,console&&console.warn&&console.warn(a)}return e}function f(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function p(e,t,n){var i={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},r=f.bind(i);return r.listener=n,i.wrapFn=r,r}function h(e,t,n){var i=e._events;if(void 0===i)return[];var r=i[t];return void 0===r?[]:"function"==typeof r?n?[r.listener||r]:[r]:n?function(e){for(var t=new Array(e.length),n=0;n0&&(o=t[0]),o instanceof Error)throw o;var a=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw a.context=o,a}var c=r[e];if(void 0===c)return!1;if("function"==typeof c)s(c,this,t);else{var u=c.length,l=b(c,u);for(n=0;n=0;s--)if(n[s]===t||n[s].listener===t){o=n[s].listener,r=s;break}if(r<0)return this;0===r?n.shift():function(e,t){for(;t+1=0;i--)this.removeListener(e,t[i]);return this},a.prototype.listeners=function(e){return h(this,e,!0)},a.prototype.rawListeners=function(e){return h(this,e,!1)},a.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):m.call(e,t)},a.prototype.listenerCount=m,a.prototype.eventNames=function(){return this._eventsCount>0?i(this._events):[]}},{}],197:[function(e,t,n){var i=e("safe-buffer").Buffer,r=e("md5.js");t.exports=function(e,t,n,s){if(i.isBuffer(e)||(e=i.from(e,"binary")),t&&(i.isBuffer(t)||(t=i.from(t,"binary")),8!==t.length))throw new RangeError("salt should be Buffer with 8 byte length");for(var o=n/8,a=i.alloc(o),c=i.alloc(s||0),u=i.alloc(0);o>0||s>0;){var l=new r;l.update(u),l.update(e),t&&l.update(t),u=l.digest();var d=0;if(o>0){var f=a.length-o;d=Math.min(o,u.length),u.copy(a,f,0,d),o-=d}if(d0){var p=c.length-s,h=Math.min(s,u.length-d);u.copy(c,p,d,d+h),s-=h}}return u.fill(0),{key:a,iv:c}}},{"md5.js":264,"safe-buffer":386}],198:[function(e,t,n){t.exports=class{constructor(e){if(!(e>0)||0!=(e-1&e))throw new Error("Max size for a FixedFIFO should be a power of two");this.buffer=new Array(e),this.mask=e-1,this.top=0,this.btm=0,this.next=null}push(e){return void 0===this.buffer[this.top]&&(this.buffer[this.top]=e,this.top=this.top+1&this.mask,!0)}shift(){const e=this.buffer[this.btm];if(void 0!==e)return this.buffer[this.btm]=void 0,this.btm=this.btm+1&this.mask,e}isEmpty(){return void 0===this.buffer[this.btm]}}},{}],199:[function(e,t,n){const i=e("./fixed-size");t.exports=class{constructor(e){this.hwm=e||16,this.head=new i(this.hwm),this.tail=this.head}push(e){if(!this.head.push(e)){const t=this.head;this.head=t.next=new i(2*this.head.buffer.length),this.head.push(e)}}shift(){const e=this.tail.shift();if(void 0===e&&this.tail.next){const e=this.tail.next;return this.tail.next=null,this.tail=e,this.tail.shift()}return e}isEmpty(){return this.head.isEmpty()}}},{"./fixed-size":198}],200:[function(e,t,n){arguments[4][32][0].apply(n,arguments)},{dup:32}],201:[function(e,t,n){arguments[4][33][0].apply(n,arguments)},{"./_stream_readable":203,"./_stream_writable":205,_process:342,dup:33,inherits:249}],202:[function(e,t,n){arguments[4][34][0].apply(n,arguments)},{"./_stream_transform":204,dup:34,inherits:249}],203:[function(e,t,n){arguments[4][35][0].apply(n,arguments)},{"../errors":200,"./_stream_duplex":201,"./internal/streams/async_iterator":206,"./internal/streams/buffer_list":207,"./internal/streams/destroy":208,"./internal/streams/from":210,"./internal/streams/state":212,"./internal/streams/stream":213,_process:342,buffer:116,dup:35,events:196,inherits:249,"string_decoder/":481,util:73}],204:[function(e,t,n){arguments[4][36][0].apply(n,arguments)},{"../errors":200,"./_stream_duplex":201,dup:36,inherits:249}],205:[function(e,t,n){arguments[4][37][0].apply(n,arguments)},{"../errors":200,"./_stream_duplex":201,"./internal/streams/destroy":208,"./internal/streams/state":212,"./internal/streams/stream":213,_process:342,buffer:116,dup:37,inherits:249,"util-deprecate":500}],206:[function(e,t,n){arguments[4][38][0].apply(n,arguments)},{"./end-of-stream":209,_process:342,dup:38}],207:[function(e,t,n){arguments[4][39][0].apply(n,arguments)},{buffer:116,dup:39,util:73}],208:[function(e,t,n){arguments[4][40][0].apply(n,arguments)},{_process:342,dup:40}],209:[function(e,t,n){arguments[4][41][0].apply(n,arguments)},{"../../../errors":200,dup:41}],210:[function(e,t,n){arguments[4][42][0].apply(n,arguments)},{dup:42}],211:[function(e,t,n){arguments[4][43][0].apply(n,arguments)},{"../../../errors":200,"./end-of-stream":209,dup:43}],212:[function(e,t,n){arguments[4][44][0].apply(n,arguments)},{"../../../errors":200,dup:44}],213:[function(e,t,n){arguments[4][45][0].apply(n,arguments)},{dup:45,events:196}],214:[function(e,t,n){arguments[4][46][0].apply(n,arguments)},{"./lib/_stream_duplex.js":201,"./lib/_stream_passthrough.js":202,"./lib/_stream_readable.js":203,"./lib/_stream_transform.js":204,"./lib/_stream_writable.js":205,"./lib/internal/streams/end-of-stream.js":209,"./lib/internal/streams/pipeline.js":211,dup:46}],215:[function(e,t,n){const{Readable:i}=e("readable-stream"),r=e("typedarray-to-buffer");t.exports=class extends i{constructor(e,t={}){super(t),this._offset=0,this._ready=!1,this._file=e,this._size=e.size,this._chunkSize=t.chunkSize||Math.max(this._size/1e3,204800);const n=new FileReader;n.onload=()=>{this.push(r(n.result))},n.onerror=()=>{this.emit("error",n.error)},this.reader=n,this._generateHeaderBlocks(e,t,((e,t)=>{if(e)return this.emit("error",e);Array.isArray(t)&&t.forEach((e=>this.push(e))),this._ready=!0,this.emit("_ready")}))}_generateHeaderBlocks(e,t,n){n(null,[])}_read(){if(!this._ready)return void this.once("_ready",this._read.bind(this));const e=this._offset;let t=this._offset+this._chunkSize;if(t>this._size&&(t=this._size),e===this._size)return this.destroy(),void this.push(null);this.reader.readAsArrayBuffer(this._file.slice(e,t)),this._offset=t}destroy(){if(this._file=null,this.reader){this.reader.onload=null,this.reader.onerror=null;try{this.reader.abort()}catch(e){}}this.reader=null}}},{"readable-stream":214,"typedarray-to-buffer":491}],216:[function(e,t,n){t.exports=function(){if("undefined"==typeof globalThis)return null;var e={RTCPeerConnection:globalThis.RTCPeerConnection||globalThis.mozRTCPeerConnection||globalThis.webkitRTCPeerConnection,RTCSessionDescription:globalThis.RTCSessionDescription||globalThis.mozRTCSessionDescription||globalThis.webkitRTCSessionDescription,RTCIceCandidate:globalThis.RTCIceCandidate||globalThis.mozRTCIceCandidate||globalThis.webkitRTCIceCandidate};return e.RTCPeerConnection?e:null}},{}],217:[function(e,t,n){"use strict";var i=e("safe-buffer").Buffer,r=e("readable-stream").Transform;function s(e){r.call(this),this._block=i.allocUnsafe(e),this._blockSize=e,this._blockOffset=0,this._length=[0,0,0,0],this._finalized=!1}e("inherits")(s,r),s.prototype._transform=function(e,t,n){var i=null;try{this.update(e,t)}catch(e){i=e}n(i)},s.prototype._flush=function(e){var t=null;try{this.push(this.digest())}catch(e){t=e}e(t)},s.prototype.update=function(e,t){if(function(e,t){if(!i.isBuffer(e)&&"string"!=typeof e)throw new TypeError(t+" must be a string or a buffer")}(e,"Data"),this._finalized)throw new Error("Digest already called");i.isBuffer(e)||(e=i.from(e,t));for(var n=this._block,r=0;this._blockOffset+e.length-r>=this._blockSize;){for(var s=this._blockOffset;s0;++o)this._length[o]+=a,(a=this._length[o]/4294967296|0)>0&&(this._length[o]-=4294967296*a);return this},s.prototype._update=function(){throw new Error("_update is not implemented")},s.prototype.digest=function(e){if(this._finalized)throw new Error("Digest already called");this._finalized=!0;var t=this._digest();void 0!==e&&(t=t.toString(e)),this._block.fill(0),this._blockOffset=0;for(var n=0;n<4;++n)this._length[n]=0;return t},s.prototype._digest=function(){throw new Error("_digest is not implemented")},t.exports=s},{inherits:249,"readable-stream":232,"safe-buffer":386}],218:[function(e,t,n){arguments[4][32][0].apply(n,arguments)},{dup:32}],219:[function(e,t,n){arguments[4][33][0].apply(n,arguments)},{"./_stream_readable":221,"./_stream_writable":223,_process:342,dup:33,inherits:249}],220:[function(e,t,n){arguments[4][34][0].apply(n,arguments)},{"./_stream_transform":222,dup:34,inherits:249}],221:[function(e,t,n){arguments[4][35][0].apply(n,arguments)},{"../errors":218,"./_stream_duplex":219,"./internal/streams/async_iterator":224,"./internal/streams/buffer_list":225,"./internal/streams/destroy":226,"./internal/streams/from":228,"./internal/streams/state":230,"./internal/streams/stream":231,_process:342,buffer:116,dup:35,events:196,inherits:249,"string_decoder/":481,util:73}],222:[function(e,t,n){arguments[4][36][0].apply(n,arguments)},{"../errors":218,"./_stream_duplex":219,dup:36,inherits:249}],223:[function(e,t,n){arguments[4][37][0].apply(n,arguments)},{"../errors":218,"./_stream_duplex":219,"./internal/streams/destroy":226,"./internal/streams/state":230,"./internal/streams/stream":231,_process:342,buffer:116,dup:37,inherits:249,"util-deprecate":500}],224:[function(e,t,n){arguments[4][38][0].apply(n,arguments)},{"./end-of-stream":227,_process:342,dup:38}],225:[function(e,t,n){arguments[4][39][0].apply(n,arguments)},{buffer:116,dup:39,util:73}],226:[function(e,t,n){arguments[4][40][0].apply(n,arguments)},{_process:342,dup:40}],227:[function(e,t,n){arguments[4][41][0].apply(n,arguments)},{"../../../errors":218,dup:41}],228:[function(e,t,n){arguments[4][42][0].apply(n,arguments)},{dup:42}],229:[function(e,t,n){arguments[4][43][0].apply(n,arguments)},{"../../../errors":218,"./end-of-stream":227,dup:43}],230:[function(e,t,n){arguments[4][44][0].apply(n,arguments)},{"../../../errors":218,dup:44}],231:[function(e,t,n){arguments[4][45][0].apply(n,arguments)},{dup:45,events:196}],232:[function(e,t,n){arguments[4][46][0].apply(n,arguments)},{"./lib/_stream_duplex.js":219,"./lib/_stream_passthrough.js":220,"./lib/_stream_readable.js":221,"./lib/_stream_transform.js":222,"./lib/_stream_writable.js":223,"./lib/internal/streams/end-of-stream.js":227,"./lib/internal/streams/pipeline.js":229,dup:46}],233:[function(e,t,n){var i=n;i.utils=e("./hash/utils"),i.common=e("./hash/common"),i.sha=e("./hash/sha"),i.ripemd=e("./hash/ripemd"),i.hmac=e("./hash/hmac"),i.sha1=i.sha.sha1,i.sha256=i.sha.sha256,i.sha224=i.sha.sha224,i.sha384=i.sha.sha384,i.sha512=i.sha.sha512,i.ripemd160=i.ripemd.ripemd160},{"./hash/common":234,"./hash/hmac":235,"./hash/ripemd":236,"./hash/sha":237,"./hash/utils":244}],234:[function(e,t,n){"use strict";var i=e("./utils"),r=e("minimalistic-assert");function s(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}n.BlockHash=s,s.prototype.update=function(e,t){if(e=i.toArray(e,t),this.pending?this.pending=this.pending.concat(e):this.pending=e,this.pendingTotal+=e.length,this.pending.length>=this._delta8){var n=(e=this.pending).length%this._delta8;this.pending=e.slice(e.length-n,e.length),0===this.pending.length&&(this.pending=null),e=i.join32(e,0,e.length-n,this.endian);for(var r=0;r>>24&255,i[r++]=e>>>16&255,i[r++]=e>>>8&255,i[r++]=255&e}else for(i[r++]=255&e,i[r++]=e>>>8&255,i[r++]=e>>>16&255,i[r++]=e>>>24&255,i[r++]=0,i[r++]=0,i[r++]=0,i[r++]=0,s=8;sthis.blockSize&&(e=(new this.Hash).update(e).digest()),r(e.length<=this.blockSize);for(var t=e.length;t>>3},n.g1_256=function(e){return i(e,17)^i(e,19)^e>>>10}},{"../utils":244}],244:[function(e,t,n){"use strict";var i=e("minimalistic-assert"),r=e("inherits");function s(e,t){return 55296==(64512&e.charCodeAt(t))&&(!(t<0||t+1>=e.length)&&56320==(64512&e.charCodeAt(t+1)))}function o(e){return(e>>>24|e>>>8&65280|e<<8&16711680|(255&e)<<24)>>>0}function a(e){return 1===e.length?"0"+e:e}function c(e){return 7===e.length?"0"+e:6===e.length?"00"+e:5===e.length?"000"+e:4===e.length?"0000"+e:3===e.length?"00000"+e:2===e.length?"000000"+e:1===e.length?"0000000"+e:e}n.inherits=r,n.toArray=function(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var n=[];if("string"==typeof e)if(t){if("hex"===t)for((e=e.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(e="0"+e),r=0;r>6|192,n[i++]=63&o|128):s(e,r)?(o=65536+((1023&o)<<10)+(1023&e.charCodeAt(++r)),n[i++]=o>>18|240,n[i++]=o>>12&63|128,n[i++]=o>>6&63|128,n[i++]=63&o|128):(n[i++]=o>>12|224,n[i++]=o>>6&63|128,n[i++]=63&o|128)}else for(r=0;r>>0}return o},n.split32=function(e,t){for(var n=new Array(4*e.length),i=0,r=0;i>>24,n[r+1]=s>>>16&255,n[r+2]=s>>>8&255,n[r+3]=255&s):(n[r+3]=s>>>24,n[r+2]=s>>>16&255,n[r+1]=s>>>8&255,n[r]=255&s)}return n},n.rotr32=function(e,t){return e>>>t|e<<32-t},n.rotl32=function(e,t){return e<>>32-t},n.sum32=function(e,t){return e+t>>>0},n.sum32_3=function(e,t,n){return e+t+n>>>0},n.sum32_4=function(e,t,n,i){return e+t+n+i>>>0},n.sum32_5=function(e,t,n,i,r){return e+t+n+i+r>>>0},n.sum64=function(e,t,n,i){var r=e[t],s=i+e[t+1]>>>0,o=(s>>0,e[t+1]=s},n.sum64_hi=function(e,t,n,i){return(t+i>>>0>>0},n.sum64_lo=function(e,t,n,i){return t+i>>>0},n.sum64_4_hi=function(e,t,n,i,r,s,o,a){var c=0,u=t;return c+=(u=u+i>>>0)>>0)>>0)>>0},n.sum64_4_lo=function(e,t,n,i,r,s,o,a){return t+i+s+a>>>0},n.sum64_5_hi=function(e,t,n,i,r,s,o,a,c,u){var l=0,d=t;return l+=(d=d+i>>>0)>>0)>>0)>>0)>>0},n.sum64_5_lo=function(e,t,n,i,r,s,o,a,c,u){return t+i+s+a+u>>>0},n.rotr64_hi=function(e,t,n){return(t<<32-n|e>>>n)>>>0},n.rotr64_lo=function(e,t,n){return(e<<32-n|t>>>n)>>>0},n.shr64_hi=function(e,t,n){return e>>>n},n.shr64_lo=function(e,t,n){return(e<<32-n|t>>>n)>>>0}},{inherits:249,"minimalistic-assert":287}],245:[function(e,t,n){"use strict";var i=e("hash.js"),r=e("minimalistic-crypto-utils"),s=e("minimalistic-assert");function o(e){if(!(this instanceof o))return new o(e);this.hash=e.hash,this.predResist=!!e.predResist,this.outLen=this.hash.outSize,this.minEntropy=e.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var t=r.toArray(e.entropy,e.entropyEnc||"hex"),n=r.toArray(e.nonce,e.nonceEnc||"hex"),i=r.toArray(e.pers,e.persEnc||"hex");s(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(t,n,i)}t.exports=o,o.prototype._init=function(e,t,n){var i=e.concat(t).concat(n);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var r=0;r=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(n||[])),this._reseed=1},o.prototype.generate=function(e,t,n,i){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof t&&(i=n,n=t,t=null),n&&(n=r.toArray(n,i||"hex"),this._update(n));for(var s=[];s.length{if(null==e)throw new Error(`invalid input type: ${e}`)})),1!==(e=e.map((e=>_(e)&&"string"==typeof e.path&&"function"==typeof b?e.path:e))).length||"string"==typeof e[0]||e[0].name||(e[0].name=t.name);let s=null;e.forEach(((t,i)=>{if("string"==typeof t)return;let n=t.fullPath||t.name;n||(n=`Unknown File ${i+1}`,t.unknownName=!0),t.path=n.split("/"),t.path[0]||t.path.shift(),t.path.length<2?s=null:0===i&&e.length>1?s=t.path[0]:t.path[0]!==s&&(s=null)}));(void 0===t.filterJunkFiles||t.filterJunkFiles)&&(e=e.filter((e=>"string"==typeof e||!g(e.path)))),s&&e.forEach((e=>{const t=(i.isBuffer(e)||x(e))&&!e.path;"string"==typeof e||t||e.path.shift()})),!t.name&&s&&(t.name=s),t.name||e.some((e=>"string"==typeof e?(t.name=a.basename(e),!0):!e.unknownName&&(t.name=e.path[e.path.length-1],!0))),t.name||(t.name=`Unnamed Torrent ${Date.now()}`);const l=e.reduce(((e,t)=>e+Number("string"==typeof t)),0);let u=1===e.length;if(1===e.length&&"string"==typeof e[0]){if("function"!=typeof b)throw new Error("filesystem paths do not work in the browser");c(e[0],((e,t)=>{if(e)return n(e);u=t,p()}))}else f(p);function p(){d(e.map((e=>t=>{const n={};if(_(e))n.getStream=function(e){return()=>new o(e)}(e),n.length=e.size;else if(i.isBuffer(e))n.getStream=(r=e,()=>{const e=new m.PassThrough;return e.end(r),e}),n.length=e.length;else{if(!x(e)){if("string"==typeof e){if("function"!=typeof b)throw new Error("filesystem paths do not work in the browser");return void b(e,l>1||u,t)}throw new Error("invalid input type")}n.getStream=function(e,t){return()=>{const i=new m.Transform;return i._transform=function(e,i,n){t.length+=e.length,this.push(e),n()},e.pipe(i),i}}(e,n),n.length=0}var r;n.path=e.path,t(null,n)})),((e,t)=>{if(e)return n(e);t=t.flat(),n(null,t,u)}))}}function g(e){const t=e[e.length-1];return"."===t[0]&&l.is(t)}function y(e,t){return e+t.length}function _(e){return"undefined"!=typeof Blob&&e instanceof Blob}function x(e){return"object"==typeof e&&null!=e&&"function"==typeof e.pipe}t.exports=function(e,a,o){"function"==typeof a&&([a,o]=[o,a]),v(e,a=a?Object.assign({},a):{},((e,c,l)=>{if(e)return o(e);a.singleFileTorrent=l,function(e,a,o){let c=a.announceList;c||("string"==typeof a.announce?c=[[a.announce]]:Array.isArray(a.announce)&&(c=a.announce.map((e=>[e]))));c||(c=[]);globalThis.WEBTORRENT_ANNOUNCE&&("string"==typeof globalThis.WEBTORRENT_ANNOUNCE?c.push([[globalThis.WEBTORRENT_ANNOUNCE]]):Array.isArray(globalThis.WEBTORRENT_ANNOUNCE)&&(c=c.concat(globalThis.WEBTORRENT_ANNOUNCE.map((e=>[e])))));void 0===a.announce&&void 0===a.announceList&&(c=c.concat(t.exports.announceList));"string"==typeof a.urlList&&(a.urlList=[a.urlList]);const l={info:{name:a.name},"creation date":Math.ceil((Number(a.creationDate)||Date.now())/1e3),encoding:"UTF-8"};0!==c.length&&(l.announce=c[0][0],l["announce-list"]=c);void 0!==a.comment&&(l.comment=a.comment);void 0!==a.createdBy&&(l["created by"]=a.createdBy);void 0!==a.private&&(l.info.private=Number(a.private));void 0!==a.info&&Object.assign(l.info,a.info);void 0!==a.sslCert&&(l.info["ssl-cert"]=a.sslCert);void 0!==a.urlList&&(l["url-list"]=a.urlList);const d=e.reduce(y,0),f=a.pieceLength||s(d);l.info["piece length"]=f,function(e,t,n,s,a){a=p(a);const o=[];let c=0,l=0;const d=e.map((e=>e.getStream));let f=0,m=0,b=!1;const v=new u(d),g=new r(t,{zeroPadding:!1});function y(e){c+=e.length;const t=m;h(e,(i=>{o[t]=i,f-=1,f<5&&g.resume(),l+=e.length,s.onProgress&&s.onProgress(l,n),k()})),f+=1,f>=5&&g.pause(),m+=1}function _(){b=!0,k()}function x(e){w(),a(e)}function w(){v.removeListener("error",x),g.removeListener("data",y),g.removeListener("end",_),g.removeListener("error",x)}function k(){b&&0===f&&(w(),a(null,i.from(o.join(""),"hex"),c))}v.on("error",x),v.pipe(g).on("data",y).on("end",_).on("error",x)}(e,f,d,a,((t,i,r)=>{if(t)return o(t);l.info.pieces=i,e.forEach((e=>{delete e.getStream})),a.singleFileTorrent?l.info.length=r:l.info.files=e,o(null,n.encode(l))}))}(c,a,o)}))},t.exports.parseInput=function(e,t,i){"function"==typeof t&&([t,i]=[i,t]),v(e,t=t?Object.assign({},t):{},i)},t.exports.announceList=[["udp://tracker.leechers-paradise.org:6969"],["udp://tracker.coppersurfer.tk:6969"],["udp://tracker.opentrackr.org:1337"],["udp://explodie.org:6969"],["udp://tracker.empire-js.us:1337"],["wss://tracker.btorrent.xyz"],["wss://tracker.openwebtorrent.com"]],t.exports.isJunkPath=g}).call(this)}).call(this,e("buffer").Buffer)},{"./get-files":67,bencode:23,"block-stream2":49,buffer:110,"filestream/read":212,"is-file":67,junk:250,multistream:309,once:326,path:333,"piece-length":340,"queue-microtask":354,"readable-stream":159,"run-parallel":381,"simple-sha1":411}],145:[function(e,t,i){arguments[4][29][0].apply(i,arguments)},{dup:29}],146:[function(e,t,i){arguments[4][30][0].apply(i,arguments)},{"./_stream_readable":148,"./_stream_writable":150,_process:341,dup:30,inherits:246}],147:[function(e,t,i){arguments[4][31][0].apply(i,arguments)},{"./_stream_transform":149,dup:31,inherits:246}],148:[function(e,t,i){arguments[4][32][0].apply(i,arguments)},{"../errors":145,"./_stream_duplex":146,"./internal/streams/async_iterator":151,"./internal/streams/buffer_list":152,"./internal/streams/destroy":153,"./internal/streams/from":155,"./internal/streams/state":157,"./internal/streams/stream":158,_process:341,buffer:110,dup:32,events:193,inherits:246,"string_decoder/":472,util:67}],149:[function(e,t,i){arguments[4][33][0].apply(i,arguments)},{"../errors":145,"./_stream_duplex":146,dup:33,inherits:246}],150:[function(e,t,i){arguments[4][34][0].apply(i,arguments)},{"../errors":145,"./_stream_duplex":146,"./internal/streams/destroy":153,"./internal/streams/state":157,"./internal/streams/stream":158,_process:341,buffer:110,dup:34,inherits:246,"util-deprecate":485}],151:[function(e,t,i){arguments[4][35][0].apply(i,arguments)},{"./end-of-stream":154,_process:341,dup:35}],152:[function(e,t,i){arguments[4][36][0].apply(i,arguments)},{buffer:110,dup:36,util:67}],153:[function(e,t,i){arguments[4][37][0].apply(i,arguments)},{_process:341,dup:37}],154:[function(e,t,i){arguments[4][38][0].apply(i,arguments)},{"../../../errors":145,dup:38}],155:[function(e,t,i){arguments[4][39][0].apply(i,arguments)},{dup:39}],156:[function(e,t,i){arguments[4][40][0].apply(i,arguments)},{"../../../errors":145,"./end-of-stream":154,dup:40}],157:[function(e,t,i){arguments[4][41][0].apply(i,arguments)},{"../../../errors":145,dup:41}],158:[function(e,t,i){arguments[4][42][0].apply(i,arguments)},{dup:42,events:193}],159:[function(e,t,i){arguments[4][43][0].apply(i,arguments)},{"./lib/_stream_duplex.js":146,"./lib/_stream_passthrough.js":147,"./lib/_stream_readable.js":148,"./lib/_stream_transform.js":149,"./lib/_stream_writable.js":150,"./lib/internal/streams/end-of-stream.js":154,"./lib/internal/streams/pipeline.js":156,dup:43}],160:[function(e,t,i){"use strict";i.randomBytes=i.rng=i.pseudoRandomBytes=i.prng=e("randombytes"),i.createHash=i.Hash=e("create-hash"),i.createHmac=i.Hmac=e("create-hmac");var n=e("browserify-sign/algos"),r=Object.keys(n),s=["sha1","sha224","sha256","sha384","sha512","md5","rmd160"].concat(r);i.getHashes=function(){return s};var a=e("pbkdf2");i.pbkdf2=a.pbkdf2,i.pbkdf2Sync=a.pbkdf2Sync;var o=e("browserify-cipher");i.Cipher=o.Cipher,i.createCipher=o.createCipher,i.Cipheriv=o.Cipheriv,i.createCipheriv=o.createCipheriv,i.Decipher=o.Decipher,i.createDecipher=o.createDecipher,i.Decipheriv=o.Decipheriv,i.createDecipheriv=o.createDecipheriv,i.getCiphers=o.getCiphers,i.listCiphers=o.listCiphers;var c=e("diffie-hellman");i.DiffieHellmanGroup=c.DiffieHellmanGroup,i.createDiffieHellmanGroup=c.createDiffieHellmanGroup,i.getDiffieHellman=c.getDiffieHellman,i.createDiffieHellman=c.createDiffieHellman,i.DiffieHellman=c.DiffieHellman;var l=e("browserify-sign");i.createSign=l.createSign,i.Sign=l.Sign,i.createVerify=l.createVerify,i.Verify=l.Verify,i.createECDH=e("create-ecdh");var u=e("public-encrypt");i.publicEncrypt=u.publicEncrypt,i.privateEncrypt=u.privateEncrypt,i.publicDecrypt=u.publicDecrypt,i.privateDecrypt=u.privateDecrypt;var p=e("randomfill");i.randomFill=p.randomFill,i.randomFillSync=p.randomFillSync,i.createCredentials=function(){throw new Error(["sorry, createCredentials is not implemented yet","we accept pull requests","https://github.com/crypto-browserify/crypto-browserify"].join("\n"))},i.constants={DH_CHECK_P_NOT_SAFE_PRIME:2,DH_CHECK_P_NOT_PRIME:1,DH_UNABLE_TO_CHECK_GENERATOR:4,DH_NOT_SUITABLE_GENERATOR:8,NPN_ENABLED:1,ALPN_ENABLED:1,RSA_PKCS1_PADDING:1,RSA_SSLV23_PADDING:2,RSA_NO_PADDING:3,RSA_PKCS1_OAEP_PADDING:4,RSA_X931_PADDING:5,RSA_PKCS1_PSS_PADDING:6,POINT_CONVERSION_COMPRESSED:2,POINT_CONVERSION_UNCOMPRESSED:4,POINT_CONVERSION_HYBRID:6}},{"browserify-cipher":85,"browserify-sign":92,"browserify-sign/algos":89,"create-ecdh":138,"create-hash":140,"create-hmac":142,"diffie-hellman":169,pbkdf2:334,"public-encrypt":342,randombytes:357,randomfill:358}],161:[function(e,t,i){(function(n){(function(){i.formatArgs=function(e){if(e[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+e[0]+(this.useColors?"%c ":" ")+"+"+t.exports.humanize(this.diff),!this.useColors)return;const i="color: "+this.color;e.splice(1,0,i,"color: inherit");let n=0,r=0;e[0].replace(/%[a-zA-Z%]/g,(e=>{"%%"!==e&&(n++,"%c"===e&&(r=n))})),e.splice(r,0,i)},i.save=function(e){try{e?i.storage.setItem("debug",e):i.storage.removeItem("debug")}catch(e){}},i.load=function(){let e;try{e=i.storage.getItem("debug")}catch(e){}!e&&void 0!==n&&"env"in n&&(e=n.env.DEBUG);return e},i.useColors=function(){if("undefined"!=typeof window&&window.process&&("renderer"===window.process.type||window.process.__nwjs))return!0;if("undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;return"undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},i.storage=function(){try{return localStorage}catch(e){}}(),i.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),i.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],i.log=console.debug||console.log||(()=>{}),t.exports=e("./common")(i);const{formatters:r}=t.exports;r.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}}).call(this)}).call(this,e("_process"))},{"./common":162,_process:341}],162:[function(e,t,i){t.exports=function(t){function i(e){let t,r,s,a=null;function o(...e){if(!o.enabled)return;const n=o,r=Number(new Date),s=r-(t||r);n.diff=s,n.prev=t,n.curr=r,t=r,e[0]=i.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");let a=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,((t,r)=>{if("%%"===t)return"%";a++;const s=i.formatters[r];if("function"==typeof s){const i=e[a];t=s.call(n,i),e.splice(a,1),a--}return t})),i.formatArgs.call(n,e);(n.log||i.log).apply(n,e)}return o.namespace=e,o.useColors=i.useColors(),o.color=i.selectColor(e),o.extend=n,o.destroy=i.destroy,Object.defineProperty(o,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==a?a:(r!==i.namespaces&&(r=i.namespaces,s=i.enabled(e)),s),set:e=>{a=e}}),"function"==typeof i.init&&i.init(o),o}function n(e,t){const n=i(this.namespace+(void 0===t?":":t)+e);return n.log=this.log,n}function r(e){return e.toString().substring(2,e.toString().length-2).replace(/\.\*\?$/,"*")}return i.debug=i,i.default=i,i.coerce=function(e){if(e instanceof Error)return e.stack||e.message;return e},i.disable=function(){const e=[...i.names.map(r),...i.skips.map(r).map((e=>"-"+e))].join(",");return i.enable(""),e},i.enable=function(e){let t;i.save(e),i.namespaces=e,i.names=[],i.skips=[];const n=("string"==typeof e?e:"").split(/[\s,]+/),r=n.length;for(t=0;t{i[e]=t[e]})),i.names=[],i.skips=[],i.formatters={},i.selectColor=function(e){let t=0;for(let i=0;i0;n--)t+=this._buffer(e,t),i+=this._flushBuffer(r,i);return t+=this._buffer(e,t),r},r.prototype.final=function(e){var t,i;return e&&(t=this.update(e)),i="encrypt"===this.type?this._finalEncrypt():this._finalDecrypt(),t?t.concat(i):i},r.prototype._pad=function(e,t){if(0===t)return!1;for(;t>>1];i=s.r28shl(i,o),r=s.r28shl(r,o),s.pc2(i,r,e.keys,a)}},c.prototype._update=function(e,t,i,n){var r=this._desState,a=s.readUInt32BE(e,t),o=s.readUInt32BE(e,t+4);s.ip(a,o,r.tmp,0),a=r.tmp[0],o=r.tmp[1],"encrypt"===this.type?this._encrypt(r,a,o,r.tmp,0):this._decrypt(r,a,o,r.tmp,0),a=r.tmp[0],o=r.tmp[1],s.writeUInt32BE(i,a,n),s.writeUInt32BE(i,o,n+4)},c.prototype._pad=function(e,t){for(var i=e.length-t,n=t;n>>0,a=d}s.rip(o,a,n,r)},c.prototype._decrypt=function(e,t,i,n,r){for(var a=i,o=t,c=e.keys.length-2;c>=0;c-=2){var l=e.keys[c],u=e.keys[c+1];s.expand(a,e.tmp,0),l^=e.tmp[0],u^=e.tmp[1];var p=s.substitute(l,u),d=a;a=(o^s.permute(p))>>>0,o=d}s.rip(a,o,n,r)}},{"./cipher":165,"./utils":168,inherits:246,"minimalistic-assert":285}],167:[function(e,t,i){"use strict";var n=e("minimalistic-assert"),r=e("inherits"),s=e("./cipher"),a=e("./des");function o(e,t){n.equal(t.length,24,"Invalid key length");var i=t.slice(0,8),r=t.slice(8,16),s=t.slice(16,24);this.ciphers="encrypt"===e?[a.create({type:"encrypt",key:i}),a.create({type:"decrypt",key:r}),a.create({type:"encrypt",key:s})]:[a.create({type:"decrypt",key:s}),a.create({type:"encrypt",key:r}),a.create({type:"decrypt",key:i})]}function c(e){s.call(this,e);var t=new o(this.type,this.options.key);this._edeState=t}r(c,s),t.exports=c,c.create=function(e){return new c(e)},c.prototype._update=function(e,t,i,n){var r=this._edeState;r.ciphers[0]._update(e,t,i,n),r.ciphers[1]._update(i,n,i,n),r.ciphers[2]._update(i,n,i,n)},c.prototype._pad=a.prototype._pad,c.prototype._unpad=a.prototype._unpad},{"./cipher":165,"./des":166,inherits:246,"minimalistic-assert":285}],168:[function(e,t,i){"use strict";i.readUInt32BE=function(e,t){return(e[0+t]<<24|e[1+t]<<16|e[2+t]<<8|e[3+t])>>>0},i.writeUInt32BE=function(e,t,i){e[0+i]=t>>>24,e[1+i]=t>>>16&255,e[2+i]=t>>>8&255,e[3+i]=255&t},i.ip=function(e,t,i,n){for(var r=0,s=0,a=6;a>=0;a-=2){for(var o=0;o<=24;o+=8)r<<=1,r|=t>>>o+a&1;for(o=0;o<=24;o+=8)r<<=1,r|=e>>>o+a&1}for(a=6;a>=0;a-=2){for(o=1;o<=25;o+=8)s<<=1,s|=t>>>o+a&1;for(o=1;o<=25;o+=8)s<<=1,s|=e>>>o+a&1}i[n+0]=r>>>0,i[n+1]=s>>>0},i.rip=function(e,t,i,n){for(var r=0,s=0,a=0;a<4;a++)for(var o=24;o>=0;o-=8)r<<=1,r|=t>>>o+a&1,r<<=1,r|=e>>>o+a&1;for(a=4;a<8;a++)for(o=24;o>=0;o-=8)s<<=1,s|=t>>>o+a&1,s<<=1,s|=e>>>o+a&1;i[n+0]=r>>>0,i[n+1]=s>>>0},i.pc1=function(e,t,i,n){for(var r=0,s=0,a=7;a>=5;a--){for(var o=0;o<=24;o+=8)r<<=1,r|=t>>o+a&1;for(o=0;o<=24;o+=8)r<<=1,r|=e>>o+a&1}for(o=0;o<=24;o+=8)r<<=1,r|=t>>o+a&1;for(a=1;a<=3;a++){for(o=0;o<=24;o+=8)s<<=1,s|=t>>o+a&1;for(o=0;o<=24;o+=8)s<<=1,s|=e>>o+a&1}for(o=0;o<=24;o+=8)s<<=1,s|=e>>o+a&1;i[n+0]=r>>>0,i[n+1]=s>>>0},i.r28shl=function(e,t){return e<>>28-t};var n=[14,11,17,4,27,23,25,0,13,22,7,18,5,9,16,24,2,20,12,21,1,8,15,26,15,4,25,19,9,1,26,16,5,11,23,8,12,7,17,0,22,3,10,14,6,20,27,24];i.pc2=function(e,t,i,r){for(var s=0,a=0,o=n.length>>>1,c=0;c>>n[c]&1;for(c=o;c>>n[c]&1;i[r+0]=s>>>0,i[r+1]=a>>>0},i.expand=function(e,t,i){var n=0,r=0;n=(1&e)<<5|e>>>27;for(var s=23;s>=15;s-=4)n<<=6,n|=e>>>s&63;for(s=11;s>=3;s-=4)r|=e>>>s&63,r<<=6;r|=(31&e)<<1|e>>>31,t[i+0]=n>>>0,t[i+1]=r>>>0};var r=[14,0,4,15,13,7,1,4,2,14,15,2,11,13,8,1,3,10,10,6,6,12,12,11,5,9,9,5,0,3,7,8,4,15,1,12,14,8,8,2,13,4,6,9,2,1,11,7,15,5,12,11,9,3,7,14,3,10,10,0,5,6,0,13,15,3,1,13,8,4,14,7,6,15,11,2,3,8,4,14,9,12,7,0,2,1,13,10,12,6,0,9,5,11,10,5,0,13,14,8,7,10,11,1,10,3,4,15,13,4,1,2,5,11,8,6,12,7,6,12,9,0,3,5,2,14,15,9,10,13,0,7,9,0,14,9,6,3,3,4,15,6,5,10,1,2,13,8,12,5,7,14,11,12,4,11,2,15,8,1,13,1,6,10,4,13,9,0,8,6,15,9,3,8,0,7,11,4,1,15,2,14,12,3,5,11,10,5,14,2,7,12,7,13,13,8,14,11,3,5,0,6,6,15,9,0,10,3,1,4,2,7,8,2,5,12,11,1,12,10,4,14,15,9,10,3,6,15,9,0,0,6,12,10,11,1,7,13,13,8,15,9,1,4,3,5,14,11,5,12,2,7,8,2,4,14,2,14,12,11,4,2,1,12,7,4,10,7,11,13,6,1,8,5,5,0,3,15,15,10,13,3,0,9,14,8,9,6,4,11,2,8,1,12,11,7,10,1,13,14,7,2,8,13,15,6,9,15,12,0,5,9,6,10,3,4,0,5,14,3,12,10,1,15,10,4,15,2,9,7,2,12,6,9,8,5,0,6,13,1,3,13,4,14,14,0,7,11,5,3,11,8,9,4,14,3,15,2,5,12,2,9,8,5,12,15,3,10,7,11,0,14,4,1,10,7,1,6,13,0,11,8,6,13,4,13,11,0,2,11,14,7,15,4,0,9,8,1,13,10,3,14,12,3,9,5,7,12,5,2,10,15,6,8,1,6,1,6,4,11,11,13,13,8,12,1,3,4,7,10,14,7,10,9,15,5,6,0,8,15,0,14,5,2,9,3,2,12,13,1,2,15,8,13,4,8,6,10,15,3,11,7,1,4,10,12,9,5,3,6,14,11,5,0,0,14,12,9,7,2,7,2,11,1,4,14,1,7,9,4,12,10,14,8,2,13,0,15,6,12,10,9,13,0,15,3,3,5,5,6,8,11];i.substitute=function(e,t){for(var i=0,n=0;n<4;n++){i<<=4,i|=r[64*n+(e>>>18-6*n&63)]}for(n=0;n<4;n++){i<<=4,i|=r[256+64*n+(t>>>18-6*n&63)]}return i>>>0};var s=[16,25,12,11,3,20,4,15,31,17,9,6,27,14,1,22,30,24,8,18,0,5,29,23,13,19,2,26,10,21,28,7];i.permute=function(e){for(var t=0,i=0;i>>s[i]&1;return t>>>0},i.padSplit=function(e,t,i){for(var n=e.toString(2);n.lengthe;)i.ishrn(1);if(i.isEven()&&i.iadd(o),i.testn(1)||i.iadd(c),t.cmp(c)){if(!t.cmp(l))for(;i.mod(u).cmp(p);)i.iadd(f)}else for(;i.mod(s).cmp(d);)i.iadd(f);if(b(h=i.shrn(1))&&b(i)&&v(h)&&v(i)&&a.test(h)&&a.test(i))return i}}},{"bn.js":173,"miller-rabin":276,randombytes:357}],172:[function(e,t,i){t.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"}}},{}],173:[function(e,t,i){arguments[4][18][0].apply(i,arguments)},{buffer:67,dup:18}],174:[function(e,t,i){"use strict";var n=i;n.version=e("../package.json").version,n.utils=e("./elliptic/utils"),n.rand=e("brorand"),n.curve=e("./elliptic/curve"),n.curves=e("./elliptic/curves"),n.ec=e("./elliptic/ec"),n.eddsa=e("./elliptic/eddsa")},{"../package.json":190,"./elliptic/curve":177,"./elliptic/curves":180,"./elliptic/ec":181,"./elliptic/eddsa":184,"./elliptic/utils":188,brorand:66}],175:[function(e,t,i){"use strict";var n=e("bn.js"),r=e("../utils"),s=r.getNAF,a=r.getJSF,o=r.assert;function c(e,t){this.type=e,this.p=new n(t.p,16),this.red=t.prime?n.red(t.prime):n.mont(this.p),this.zero=new n(0).toRed(this.red),this.one=new n(1).toRed(this.red),this.two=new n(2).toRed(this.red),this.n=t.n&&new n(t.n,16),this.g=t.g&&this.pointFromJSON(t.g,t.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var i=this.n&&this.p.div(this.n);!i||i.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}function l(e,t){this.curve=e,this.type=t,this.precomputed=null}t.exports=c,c.prototype.point=function(){throw new Error("Not implemented")},c.prototype.validate=function(){throw new Error("Not implemented")},c.prototype._fixedNafMul=function(e,t){o(e.precomputed);var i=e._getDoubles(),n=s(t,1,this._bitLength),r=(1<=a;u--)c=(c<<1)+n[u];l.push(c)}for(var p=this.jpoint(null,null,null),d=this.jpoint(null,null,null),f=r;f>0;f--){for(a=0;a=0;l--){for(var u=0;l>=0&&0===a[l];l--)u++;if(l>=0&&u++,c=c.dblp(u),l<0)break;var p=a[l];o(0!==p),c="affine"===e.type?p>0?c.mixedAdd(r[p-1>>1]):c.mixedAdd(r[-p-1>>1].neg()):p>0?c.add(r[p-1>>1]):c.add(r[-p-1>>1].neg())}return"affine"===e.type?c.toP():c},c.prototype._wnafMulAdd=function(e,t,i,n,r){var o,c,l,u=this._wnafT1,p=this._wnafT2,d=this._wnafT3,f=0;for(o=0;o=1;o-=2){var m=o-1,b=o;if(1===u[m]&&1===u[b]){var v=[t[m],null,null,t[b]];0===t[m].y.cmp(t[b].y)?(v[1]=t[m].add(t[b]),v[2]=t[m].toJ().mixedAdd(t[b].neg())):0===t[m].y.cmp(t[b].y.redNeg())?(v[1]=t[m].toJ().mixedAdd(t[b]),v[2]=t[m].add(t[b].neg())):(v[1]=t[m].toJ().mixedAdd(t[b]),v[2]=t[m].toJ().mixedAdd(t[b].neg()));var g=[-3,-1,-5,-7,0,7,5,1,3],y=a(i[m],i[b]);for(f=Math.max(y[0].length,f),d[m]=new Array(f),d[b]=new Array(f),c=0;c=0;o--){for(var E=0;o>=0;){var S=!0;for(c=0;c=0&&E++,w=w.dblp(E),o<0)break;for(c=0;c0?l=p[c][M-1>>1]:M<0&&(l=p[c][-M-1>>1].neg()),w="affine"===l.type?w.mixedAdd(l):w.add(l))}}for(o=0;o=Math.ceil((e.bitLength()+1)/t.step)},l.prototype._getDoubles=function(e,t){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var i=[this],n=this,r=0;r":""},l.prototype.isInfinity=function(){return 0===this.x.cmpn(0)&&(0===this.y.cmp(this.z)||this.zOne&&0===this.y.cmp(this.curve.c))},l.prototype._extDbl=function(){var e=this.x.redSqr(),t=this.y.redSqr(),i=this.z.redSqr();i=i.redIAdd(i);var n=this.curve._mulA(e),r=this.x.redAdd(this.y).redSqr().redISub(e).redISub(t),s=n.redAdd(t),a=s.redSub(i),o=n.redSub(t),c=r.redMul(a),l=s.redMul(o),u=r.redMul(o),p=a.redMul(s);return this.curve.point(c,l,p,u)},l.prototype._projDbl=function(){var e,t,i,n,r,s,a=this.x.redAdd(this.y).redSqr(),o=this.x.redSqr(),c=this.y.redSqr();if(this.curve.twisted){var l=(n=this.curve._mulA(o)).redAdd(c);this.zOne?(e=a.redSub(o).redSub(c).redMul(l.redSub(this.curve.two)),t=l.redMul(n.redSub(c)),i=l.redSqr().redSub(l).redSub(l)):(r=this.z.redSqr(),s=l.redSub(r).redISub(r),e=a.redSub(o).redISub(c).redMul(s),t=l.redMul(n.redSub(c)),i=l.redMul(s))}else n=o.redAdd(c),r=this.curve._mulC(this.z).redSqr(),s=n.redSub(r).redSub(r),e=this.curve._mulC(a.redISub(n)).redMul(s),t=this.curve._mulC(n).redMul(o.redISub(c)),i=n.redMul(s);return this.curve.point(e,t,i)},l.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},l.prototype._extAdd=function(e){var t=this.y.redSub(this.x).redMul(e.y.redSub(e.x)),i=this.y.redAdd(this.x).redMul(e.y.redAdd(e.x)),n=this.t.redMul(this.curve.dd).redMul(e.t),r=this.z.redMul(e.z.redAdd(e.z)),s=i.redSub(t),a=r.redSub(n),o=r.redAdd(n),c=i.redAdd(t),l=s.redMul(a),u=o.redMul(c),p=s.redMul(c),d=a.redMul(o);return this.curve.point(l,u,d,p)},l.prototype._projAdd=function(e){var t,i,n=this.z.redMul(e.z),r=n.redSqr(),s=this.x.redMul(e.x),a=this.y.redMul(e.y),o=this.curve.d.redMul(s).redMul(a),c=r.redSub(o),l=r.redAdd(o),u=this.x.redAdd(this.y).redMul(e.x.redAdd(e.y)).redISub(s).redISub(a),p=n.redMul(c).redMul(u);return this.curve.twisted?(t=n.redMul(l).redMul(a.redSub(this.curve._mulA(s))),i=c.redMul(l)):(t=n.redMul(l).redMul(a.redSub(s)),i=this.curve._mulC(c).redMul(l)),this.curve.point(p,t,i)},l.prototype.add=function(e){return this.isInfinity()?e:e.isInfinity()?this:this.curve.extended?this._extAdd(e):this._projAdd(e)},l.prototype.mul=function(e){return this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve._wnafMul(this,e)},l.prototype.mulAdd=function(e,t,i){return this.curve._wnafMulAdd(1,[this,t],[e,i],2,!1)},l.prototype.jmulAdd=function(e,t,i){return this.curve._wnafMulAdd(1,[this,t],[e,i],2,!0)},l.prototype.normalize=function(){if(this.zOne)return this;var e=this.z.redInvm();return this.x=this.x.redMul(e),this.y=this.y.redMul(e),this.t&&(this.t=this.t.redMul(e)),this.z=this.curve.one,this.zOne=!0,this},l.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},l.prototype.getX=function(){return this.normalize(),this.x.fromRed()},l.prototype.getY=function(){return this.normalize(),this.y.fromRed()},l.prototype.eq=function(e){return this===e||0===this.getX().cmp(e.getX())&&0===this.getY().cmp(e.getY())},l.prototype.eqXToP=function(e){var t=e.toRed(this.curve.red).redMul(this.z);if(0===this.x.cmp(t))return!0;for(var i=e.clone(),n=this.curve.redN.redMul(this.z);;){if(i.iadd(this.curve.n),i.cmp(this.curve.p)>=0)return!1;if(t.redIAdd(n),0===this.x.cmp(t))return!0}},l.prototype.toP=l.prototype.normalize,l.prototype.mixedAdd=l.prototype.add},{"../utils":188,"./base":175,"bn.js":189,inherits:246}],177:[function(e,t,i){"use strict";var n=i;n.base=e("./base"),n.short=e("./short"),n.mont=e("./mont"),n.edwards=e("./edwards")},{"./base":175,"./edwards":176,"./mont":178,"./short":179}],178:[function(e,t,i){"use strict";var n=e("bn.js"),r=e("inherits"),s=e("./base"),a=e("../utils");function o(e){s.call(this,"mont",e),this.a=new n(e.a,16).toRed(this.red),this.b=new n(e.b,16).toRed(this.red),this.i4=new n(4).toRed(this.red).redInvm(),this.two=new n(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}function c(e,t,i){s.BasePoint.call(this,e,"projective"),null===t&&null===i?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new n(t,16),this.z=new n(i,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}r(o,s),t.exports=o,o.prototype.validate=function(e){var t=e.normalize().x,i=t.redSqr(),n=i.redMul(t).redAdd(i.redMul(this.a)).redAdd(t);return 0===n.redSqrt().redSqr().cmp(n)},r(c,s.BasePoint),o.prototype.decodePoint=function(e,t){return this.point(a.toArray(e,t),1)},o.prototype.point=function(e,t){return new c(this,e,t)},o.prototype.pointFromJSON=function(e){return c.fromJSON(this,e)},c.prototype.precompute=function(){},c.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},c.fromJSON=function(e,t){return new c(e,t[0],t[1]||e.one)},c.prototype.inspect=function(){return this.isInfinity()?"":""},c.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},c.prototype.dbl=function(){var e=this.x.redAdd(this.z).redSqr(),t=this.x.redSub(this.z).redSqr(),i=e.redSub(t),n=e.redMul(t),r=i.redMul(t.redAdd(this.curve.a24.redMul(i)));return this.curve.point(n,r)},c.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},c.prototype.diffAdd=function(e,t){var i=this.x.redAdd(this.z),n=this.x.redSub(this.z),r=e.x.redAdd(e.z),s=e.x.redSub(e.z).redMul(i),a=r.redMul(n),o=t.z.redMul(s.redAdd(a).redSqr()),c=t.x.redMul(s.redISub(a).redSqr());return this.curve.point(o,c)},c.prototype.mul=function(e){for(var t=e.clone(),i=this,n=this.curve.point(null,null),r=[];0!==t.cmpn(0);t.iushrn(1))r.push(t.andln(1));for(var s=r.length-1;s>=0;s--)0===r[s]?(i=i.diffAdd(n,this),n=n.dbl()):(n=i.diffAdd(n,this),i=i.dbl());return n},c.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},c.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")},c.prototype.eq=function(e){return 0===this.getX().cmp(e.getX())},c.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},c.prototype.getX=function(){return this.normalize(),this.x.fromRed()}},{"../utils":188,"./base":175,"bn.js":189,inherits:246}],179:[function(e,t,i){"use strict";var n=e("../utils"),r=e("bn.js"),s=e("inherits"),a=e("./base"),o=n.assert;function c(e){a.call(this,"short",e),this.a=new r(e.a,16).toRed(this.red),this.b=new r(e.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=0===this.a.fromRed().cmpn(0),this.threeA=0===this.a.fromRed().sub(this.p).cmpn(-3),this.endo=this._getEndomorphism(e),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}function l(e,t,i,n){a.BasePoint.call(this,e,"affine"),null===t&&null===i?(this.x=null,this.y=null,this.inf=!0):(this.x=new r(t,16),this.y=new r(i,16),n&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.inf=!1)}function u(e,t,i,n){a.BasePoint.call(this,e,"jacobian"),null===t&&null===i&&null===n?(this.x=this.curve.one,this.y=this.curve.one,this.z=new r(0)):(this.x=new r(t,16),this.y=new r(i,16),this.z=new r(n,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}s(c,a),t.exports=c,c.prototype._getEndomorphism=function(e){if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3)){var t,i;if(e.beta)t=new r(e.beta,16).toRed(this.red);else{var n=this._getEndoRoots(this.p);t=(t=n[0].cmp(n[1])<0?n[0]:n[1]).toRed(this.red)}if(e.lambda)i=new r(e.lambda,16);else{var s=this._getEndoRoots(this.n);0===this.g.mul(s[0]).x.cmp(this.g.x.redMul(t))?i=s[0]:(i=s[1],o(0===this.g.mul(i).x.cmp(this.g.x.redMul(t))))}return{beta:t,lambda:i,basis:e.basis?e.basis.map((function(e){return{a:new r(e.a,16),b:new r(e.b,16)}})):this._getEndoBasis(i)}}},c.prototype._getEndoRoots=function(e){var t=e===this.p?this.red:r.mont(e),i=new r(2).toRed(t).redInvm(),n=i.redNeg(),s=new r(3).toRed(t).redNeg().redSqrt().redMul(i);return[n.redAdd(s).fromRed(),n.redSub(s).fromRed()]},c.prototype._getEndoBasis=function(e){for(var t,i,n,s,a,o,c,l,u,p=this.n.ushrn(Math.floor(this.n.bitLength()/2)),d=e,f=this.n.clone(),h=new r(1),m=new r(0),b=new r(0),v=new r(1),g=0;0!==d.cmpn(0);){var y=f.div(d);l=f.sub(y.mul(d)),u=b.sub(y.mul(h));var _=v.sub(y.mul(m));if(!n&&l.cmp(p)<0)t=c.neg(),i=h,n=l.neg(),s=u;else if(n&&2==++g)break;c=l,f=d,d=l,b=h,h=u,v=m,m=_}a=l.neg(),o=u;var x=n.sqr().add(s.sqr());return a.sqr().add(o.sqr()).cmp(x)>=0&&(a=t,o=i),n.negative&&(n=n.neg(),s=s.neg()),a.negative&&(a=a.neg(),o=o.neg()),[{a:n,b:s},{a:a,b:o}]},c.prototype._endoSplit=function(e){var t=this.endo.basis,i=t[0],n=t[1],r=n.b.mul(e).divRound(this.n),s=i.b.neg().mul(e).divRound(this.n),a=r.mul(i.a),o=s.mul(n.a),c=r.mul(i.b),l=s.mul(n.b);return{k1:e.sub(a).sub(o),k2:c.add(l).neg()}},c.prototype.pointFromX=function(e,t){(e=new r(e,16)).red||(e=e.toRed(this.red));var i=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),n=i.redSqrt();if(0!==n.redSqr().redSub(i).cmp(this.zero))throw new Error("invalid point");var s=n.fromRed().isOdd();return(t&&!s||!t&&s)&&(n=n.redNeg()),this.point(e,n)},c.prototype.validate=function(e){if(e.inf)return!0;var t=e.x,i=e.y,n=this.a.redMul(t),r=t.redSqr().redMul(t).redIAdd(n).redIAdd(this.b);return 0===i.redSqr().redISub(r).cmpn(0)},c.prototype._endoWnafMulAdd=function(e,t,i){for(var n=this._endoWnafT1,r=this._endoWnafT2,s=0;s":""},l.prototype.isInfinity=function(){return this.inf},l.prototype.add=function(e){if(this.inf)return e;if(e.inf)return this;if(this.eq(e))return this.dbl();if(this.neg().eq(e))return this.curve.point(null,null);if(0===this.x.cmp(e.x))return this.curve.point(null,null);var t=this.y.redSub(e.y);0!==t.cmpn(0)&&(t=t.redMul(this.x.redSub(e.x).redInvm()));var i=t.redSqr().redISub(this.x).redISub(e.x),n=t.redMul(this.x.redSub(i)).redISub(this.y);return this.curve.point(i,n)},l.prototype.dbl=function(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(0===e.cmpn(0))return this.curve.point(null,null);var t=this.curve.a,i=this.x.redSqr(),n=e.redInvm(),r=i.redAdd(i).redIAdd(i).redIAdd(t).redMul(n),s=r.redSqr().redISub(this.x.redAdd(this.x)),a=r.redMul(this.x.redSub(s)).redISub(this.y);return this.curve.point(s,a)},l.prototype.getX=function(){return this.x.fromRed()},l.prototype.getY=function(){return this.y.fromRed()},l.prototype.mul=function(e){return e=new r(e,16),this.isInfinity()?this:this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)},l.prototype.mulAdd=function(e,t,i){var n=[this,t],r=[e,i];return this.curve.endo?this.curve._endoWnafMulAdd(n,r):this.curve._wnafMulAdd(1,n,r,2)},l.prototype.jmulAdd=function(e,t,i){var n=[this,t],r=[e,i];return this.curve.endo?this.curve._endoWnafMulAdd(n,r,!0):this.curve._wnafMulAdd(1,n,r,2,!0)},l.prototype.eq=function(e){return this===e||this.inf===e.inf&&(this.inf||0===this.x.cmp(e.x)&&0===this.y.cmp(e.y))},l.prototype.neg=function(e){if(this.inf)return this;var t=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var i=this.precomputed,n=function(e){return e.neg()};t.precomputed={naf:i.naf&&{wnd:i.naf.wnd,points:i.naf.points.map(n)},doubles:i.doubles&&{step:i.doubles.step,points:i.doubles.points.map(n)}}}return t},l.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},s(u,a.BasePoint),c.prototype.jpoint=function(e,t,i){return new u(this,e,t,i)},u.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),t=e.redSqr(),i=this.x.redMul(t),n=this.y.redMul(t).redMul(e);return this.curve.point(i,n)},u.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},u.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var t=e.z.redSqr(),i=this.z.redSqr(),n=this.x.redMul(t),r=e.x.redMul(i),s=this.y.redMul(t.redMul(e.z)),a=e.y.redMul(i.redMul(this.z)),o=n.redSub(r),c=s.redSub(a);if(0===o.cmpn(0))return 0!==c.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var l=o.redSqr(),u=l.redMul(o),p=n.redMul(l),d=c.redSqr().redIAdd(u).redISub(p).redISub(p),f=c.redMul(p.redISub(d)).redISub(s.redMul(u)),h=this.z.redMul(e.z).redMul(o);return this.curve.jpoint(d,f,h)},u.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var t=this.z.redSqr(),i=this.x,n=e.x.redMul(t),r=this.y,s=e.y.redMul(t).redMul(this.z),a=i.redSub(n),o=r.redSub(s);if(0===a.cmpn(0))return 0!==o.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var c=a.redSqr(),l=c.redMul(a),u=i.redMul(c),p=o.redSqr().redIAdd(l).redISub(u).redISub(u),d=o.redMul(u.redISub(p)).redISub(r.redMul(l)),f=this.z.redMul(a);return this.curve.jpoint(p,d,f)},u.prototype.dblp=function(e){if(0===e)return this;if(this.isInfinity())return this;if(!e)return this.dbl();var t;if(this.curve.zeroA||this.curve.threeA){var i=this;for(t=0;t=0)return!1;if(i.redIAdd(r),0===this.x.cmp(i))return!0}},u.prototype.inspect=function(){return this.isInfinity()?"":""},u.prototype.isInfinity=function(){return 0===this.z.cmpn(0)}},{"../utils":188,"./base":175,"bn.js":189,inherits:246}],180:[function(e,t,i){"use strict";var n,r=i,s=e("hash.js"),a=e("./curve"),o=e("./utils").assert;function c(e){"short"===e.type?this.curve=new a.short(e):"edwards"===e.type?this.curve=new a.edwards(e):this.curve=new a.mont(e),this.g=this.curve.g,this.n=this.curve.n,this.hash=e.hash,o(this.g.validate(),"Invalid curve"),o(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function l(e,t){Object.defineProperty(r,e,{configurable:!0,enumerable:!0,get:function(){var i=new c(t);return Object.defineProperty(r,e,{configurable:!0,enumerable:!0,value:i}),i}})}r.PresetCurve=c,l("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:s.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),l("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:s.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),l("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:s.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),l("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:s.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),l("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:s.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),l("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:s.sha256,gRed:!1,g:["9"]}),l("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:s.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{n=e("./precomputed/secp256k1")}catch(e){n=void 0}l("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:s.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",n]})},{"./curve":177,"./precomputed/secp256k1":187,"./utils":188,"hash.js":230}],181:[function(e,t,i){"use strict";var n=e("bn.js"),r=e("hmac-drbg"),s=e("../utils"),a=e("../curves"),o=e("brorand"),c=s.assert,l=e("./key"),u=e("./signature");function p(e){if(!(this instanceof p))return new p(e);"string"==typeof e&&(c(Object.prototype.hasOwnProperty.call(a,e),"Unknown curve "+e),e=a[e]),e instanceof a.PresetCurve&&(e={curve:e}),this.curve=e.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=e.curve.g,this.g.precompute(e.curve.n.bitLength()+1),this.hash=e.hash||e.curve.hash}t.exports=p,p.prototype.keyPair=function(e){return new l(this,e)},p.prototype.keyFromPrivate=function(e,t){return l.fromPrivate(this,e,t)},p.prototype.keyFromPublic=function(e,t){return l.fromPublic(this,e,t)},p.prototype.genKeyPair=function(e){e||(e={});for(var t=new r({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||o(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),i=this.n.byteLength(),s=this.n.sub(new n(2));;){var a=new n(t.generate(i));if(!(a.cmp(s)>0))return a.iaddn(1),this.keyFromPrivate(a)}},p.prototype._truncateToN=function(e,t){var i=8*e.byteLength()-this.n.bitLength();return i>0&&(e=e.ushrn(i)),!t&&e.cmp(this.n)>=0?e.sub(this.n):e},p.prototype.sign=function(e,t,i,s){"object"==typeof i&&(s=i,i=null),s||(s={}),t=this.keyFromPrivate(t,i),e=this._truncateToN(new n(e,16));for(var a=this.n.byteLength(),o=t.getPrivate().toArray("be",a),c=e.toArray("be",a),l=new r({hash:this.hash,entropy:o,nonce:c,pers:s.pers,persEnc:s.persEnc||"utf8"}),p=this.n.sub(new n(1)),d=0;;d++){var f=s.k?s.k(d):new n(l.generate(this.n.byteLength()));if(!((f=this._truncateToN(f,!0)).cmpn(1)<=0||f.cmp(p)>=0)){var h=this.g.mul(f);if(!h.isInfinity()){var m=h.getX(),b=m.umod(this.n);if(0!==b.cmpn(0)){var v=f.invm(this.n).mul(b.mul(t.getPrivate()).iadd(e));if(0!==(v=v.umod(this.n)).cmpn(0)){var g=(h.getY().isOdd()?1:0)|(0!==m.cmp(b)?2:0);return s.canonical&&v.cmp(this.nh)>0&&(v=this.n.sub(v),g^=1),new u({r:b,s:v,recoveryParam:g})}}}}}},p.prototype.verify=function(e,t,i,r){e=this._truncateToN(new n(e,16)),i=this.keyFromPublic(i,r);var s=(t=new u(t,"hex")).r,a=t.s;if(s.cmpn(1)<0||s.cmp(this.n)>=0)return!1;if(a.cmpn(1)<0||a.cmp(this.n)>=0)return!1;var o,c=a.invm(this.n),l=c.mul(e).umod(this.n),p=c.mul(s).umod(this.n);return this.curve._maxwellTrick?!(o=this.g.jmulAdd(l,i.getPublic(),p)).isInfinity()&&o.eqXToP(s):!(o=this.g.mulAdd(l,i.getPublic(),p)).isInfinity()&&0===o.getX().umod(this.n).cmp(s)},p.prototype.recoverPubKey=function(e,t,i,r){c((3&i)===i,"The recovery param is more than two bits"),t=new u(t,r);var s=this.n,a=new n(e),o=t.r,l=t.s,p=1&i,d=i>>1;if(o.cmp(this.curve.p.umod(this.curve.n))>=0&&d)throw new Error("Unable to find sencond key candinate");o=d?this.curve.pointFromX(o.add(this.curve.n),p):this.curve.pointFromX(o,p);var f=t.r.invm(s),h=s.sub(a).mul(f).umod(s),m=l.mul(f).umod(s);return this.g.mulAdd(h,o,m)},p.prototype.getKeyRecoveryParam=function(e,t,i,n){if(null!==(t=new u(t,n)).recoveryParam)return t.recoveryParam;for(var r=0;r<4;r++){var s;try{s=this.recoverPubKey(e,t,r)}catch(e){continue}if(s.eq(i))return r}throw new Error("Unable to find valid recovery factor")}},{"../curves":180,"../utils":188,"./key":182,"./signature":183,"bn.js":189,brorand:66,"hmac-drbg":242}],182:[function(e,t,i){"use strict";var n=e("bn.js"),r=e("../utils").assert;function s(e,t){this.ec=e,this.priv=null,this.pub=null,t.priv&&this._importPrivate(t.priv,t.privEnc),t.pub&&this._importPublic(t.pub,t.pubEnc)}t.exports=s,s.fromPublic=function(e,t,i){return t instanceof s?t:new s(e,{pub:t,pubEnc:i})},s.fromPrivate=function(e,t,i){return t instanceof s?t:new s(e,{priv:t,privEnc:i})},s.prototype.validate=function(){var e=this.getPublic();return e.isInfinity()?{result:!1,reason:"Invalid public key"}:e.validate()?e.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}},s.prototype.getPublic=function(e,t){return"string"==typeof e&&(t=e,e=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),t?this.pub.encode(t,e):this.pub},s.prototype.getPrivate=function(e){return"hex"===e?this.priv.toString(16,2):this.priv},s.prototype._importPrivate=function(e,t){this.priv=new n(e,t||16),this.priv=this.priv.umod(this.ec.curve.n)},s.prototype._importPublic=function(e,t){if(e.x||e.y)return"mont"===this.ec.curve.type?r(e.x,"Need x coordinate"):"short"!==this.ec.curve.type&&"edwards"!==this.ec.curve.type||r(e.x&&e.y,"Need both x and y coordinate"),void(this.pub=this.ec.curve.point(e.x,e.y));this.pub=this.ec.curve.decodePoint(e,t)},s.prototype.derive=function(e){return e.validate()||r(e.validate(),"public point not validated"),e.mul(this.priv).getX()},s.prototype.sign=function(e,t,i){return this.ec.sign(e,this,t,i)},s.prototype.verify=function(e,t){return this.ec.verify(e,t,this)},s.prototype.inspect=function(){return""}},{"../utils":188,"bn.js":189}],183:[function(e,t,i){"use strict";var n=e("bn.js"),r=e("../utils"),s=r.assert;function a(e,t){if(e instanceof a)return e;this._importDER(e,t)||(s(e.r&&e.s,"Signature without r or s"),this.r=new n(e.r,16),this.s=new n(e.s,16),void 0===e.recoveryParam?this.recoveryParam=null:this.recoveryParam=e.recoveryParam)}function o(){this.place=0}function c(e,t){var i=e[t.place++];if(!(128&i))return i;var n=15&i;if(0===n||n>4)return!1;for(var r=0,s=0,a=t.place;s>>=0;return!(r<=127)&&(t.place=a,r)}function l(e){for(var t=0,i=e.length-1;!e[t]&&!(128&e[t+1])&&t>>3);for(e.push(128|i);--i;)e.push(t>>>(i<<3)&255);e.push(t)}}t.exports=a,a.prototype._importDER=function(e,t){e=r.toArray(e,t);var i=new o;if(48!==e[i.place++])return!1;var s=c(e,i);if(!1===s)return!1;if(s+i.place!==e.length)return!1;if(2!==e[i.place++])return!1;var a=c(e,i);if(!1===a)return!1;var l=e.slice(i.place,a+i.place);if(i.place+=a,2!==e[i.place++])return!1;var u=c(e,i);if(!1===u)return!1;if(e.length!==u+i.place)return!1;var p=e.slice(i.place,u+i.place);if(0===l[0]){if(!(128&l[1]))return!1;l=l.slice(1)}if(0===p[0]){if(!(128&p[1]))return!1;p=p.slice(1)}return this.r=new n(l),this.s=new n(p),this.recoveryParam=null,!0},a.prototype.toDER=function(e){var t=this.r.toArray(),i=this.s.toArray();for(128&t[0]&&(t=[0].concat(t)),128&i[0]&&(i=[0].concat(i)),t=l(t),i=l(i);!(i[0]||128&i[1]);)i=i.slice(1);var n=[2];u(n,t.length),(n=n.concat(t)).push(2),u(n,i.length);var s=n.concat(i),a=[48];return u(a,s.length),a=a.concat(s),r.encode(a,e)}},{"../utils":188,"bn.js":189}],184:[function(e,t,i){"use strict";var n=e("hash.js"),r=e("../curves"),s=e("../utils"),a=s.assert,o=s.parseBytes,c=e("./key"),l=e("./signature");function u(e){if(a("ed25519"===e,"only tested with ed25519 so far"),!(this instanceof u))return new u(e);e=r[e].curve,this.curve=e,this.g=e.g,this.g.precompute(e.n.bitLength()+1),this.pointClass=e.point().constructor,this.encodingLength=Math.ceil(e.n.bitLength()/8),this.hash=n.sha512}t.exports=u,u.prototype.sign=function(e,t){e=o(e);var i=this.keyFromSecret(t),n=this.hashInt(i.messagePrefix(),e),r=this.g.mul(n),s=this.encodePoint(r),a=this.hashInt(s,i.pubBytes(),e).mul(i.priv()),c=n.add(a).umod(this.curve.n);return this.makeSignature({R:r,S:c,Rencoded:s})},u.prototype.verify=function(e,t,i){e=o(e),t=this.makeSignature(t);var n=this.keyFromPublic(i),r=this.hashInt(t.Rencoded(),n.pubBytes(),e),s=this.g.mul(t.S());return t.R().add(n.pub().mul(r)).eq(s)},u.prototype.hashInt=function(){for(var e=this.hash(),t=0;t(r>>1)-1?(r>>1)-c:c,s.isubn(o)):o=0,n[a]=o,s.iushrn(1)}return n},n.getJSF=function(e,t){var i=[[],[]];e=e.clone(),t=t.clone();for(var n,r=0,s=0;e.cmpn(-r)>0||t.cmpn(-s)>0;){var a,o,c=e.andln(3)+r&3,l=t.andln(3)+s&3;3===c&&(c=-1),3===l&&(l=-1),a=0==(1&c)?0:3!==(n=e.andln(7)+r&7)&&5!==n||2!==l?c:-c,i[0].push(a),o=0==(1&l)?0:3!==(n=t.andln(7)+s&7)&&5!==n||2!==c?l:-l,i[1].push(o),2*r===a+1&&(r=1-r),2*s===o+1&&(s=1-s),e.iushrn(1),t.iushrn(1)}return i},n.cachedProperty=function(e,t,i){var n="_"+t;e.prototype[t]=function(){return void 0!==this[n]?this[n]:this[n]=i.call(this)}},n.parseBytes=function(e){return"string"==typeof e?n.toArray(e,"hex"):e},n.intFromLE=function(e){return new r(e,"hex","le")}},{"bn.js":189,"minimalistic-assert":285,"minimalistic-crypto-utils":286}],189:[function(e,t,i){arguments[4][18][0].apply(i,arguments)},{buffer:67,dup:18}],190:[function(e,t,i){t.exports={_from:"elliptic@^6.5.3",_id:"elliptic@6.5.4",_inBundle:!1,_integrity:"sha512-iLhC6ULemrljPZb+QutR5TQGB+pdW6KGD5RSegS+8sorOZT+rdQFbsQFJgvN3eRqNALqJer4oQ16YvJHlU8hzQ==",_location:"/elliptic",_phantomChildren:{},_requested:{type:"range",registry:!0,raw:"elliptic@^6.5.3",name:"elliptic",escapedName:"elliptic",rawSpec:"^6.5.3",saveSpec:null,fetchSpec:"^6.5.3"},_requiredBy:["/browserify-sign","/create-ecdh"],_resolved:"https://registry.npmjs.org/elliptic/-/elliptic-6.5.4.tgz",_shasum:"da37cebd31e79a1367e941b592ed1fbebd58abbb",_spec:"elliptic@^6.5.3",_where:"/workspaces/TorrentParts/node_modules/browserify-sign",author:{name:"Fedor Indutny",email:"fedor@indutny.com"},bugs:{url:"https://github.com/indutny/elliptic/issues"},bundleDependencies:!1,dependencies:{"bn.js":"^4.11.9",brorand:"^1.1.0","hash.js":"^1.0.0","hmac-drbg":"^1.0.1",inherits:"^2.0.4","minimalistic-assert":"^1.0.1","minimalistic-crypto-utils":"^1.0.1"},deprecated:!1,description:"EC cryptography",devDependencies:{brfs:"^2.0.2",coveralls:"^3.1.0",eslint:"^7.6.0",grunt:"^1.2.1","grunt-browserify":"^5.3.0","grunt-cli":"^1.3.2","grunt-contrib-connect":"^3.0.0","grunt-contrib-copy":"^1.0.0","grunt-contrib-uglify":"^5.0.0","grunt-mocha-istanbul":"^5.0.2","grunt-saucelabs":"^9.0.1",istanbul:"^0.4.5",mocha:"^8.0.1"},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:{lint:"eslint lib test","lint:fix":"npm run lint -- --fix",test:"npm run lint && npm run unit",unit:"istanbul test _mocha --reporter=spec test/index.js",version:"grunt dist && git add dist/"},version:"6.5.4"}},{}],191:[function(e,t,i){(function(i){(function(){var n=e("once"),r=function(){},s=function(e,t,a){if("function"==typeof t)return s(e,null,t);t||(t={}),a=n(a||r);var o=e._writableState,c=e._readableState,l=t.readable||!1!==t.readable&&e.readable,u=t.writable||!1!==t.writable&&e.writable,p=!1,d=function(){e.writable||f()},f=function(){u=!1,l||a.call(e)},h=function(){l=!1,u||a.call(e)},m=function(t){a.call(e,t?new Error("exited with error code: "+t):null)},b=function(t){a.call(e,t)},v=function(){i.nextTick(g)},g=function(){if(!p)return(!l||c&&c.ended&&!c.destroyed)&&(!u||o&&o.ended&&!o.destroyed)?void 0:a.call(e,new Error("premature close"))},y=function(){e.req.on("finish",f)};return!function(e){return e.setHeader&&"function"==typeof e.abort}(e)?u&&!o&&(e.on("end",d),e.on("close",d)):(e.on("complete",f),e.on("abort",v),e.req?y():e.on("request",y)),function(e){return e.stdio&&Array.isArray(e.stdio)&&3===e.stdio.length}(e)&&e.on("exit",m),e.on("end",h),e.on("finish",f),!1!==t.error&&e.on("error",b),e.on("close",v),function(){p=!0,e.removeListener("complete",f),e.removeListener("abort",v),e.removeListener("request",y),e.req&&e.req.removeListener("finish",f),e.removeListener("end",d),e.removeListener("close",d),e.removeListener("finish",f),e.removeListener("exit",m),e.removeListener("end",h),e.removeListener("error",b),e.removeListener("close",v)}};t.exports=s}).call(this)}).call(this,e("_process"))},{_process:341,once:326}],192:[function(e,t,i){"use strict";function n(e,t){for(const i in t)Object.defineProperty(e,i,{value:t[i],enumerable:!0,configurable:!0});return e}t.exports=function(e,t,i){if(!e||"string"==typeof e)throw new TypeError("Please pass an Error to err-code");i||(i={}),"object"==typeof t&&(i=t,t=""),t&&(i.code=t);try{return n(e,i)}catch(t){i.message=e.message,i.stack=e.stack;const r=function(){};r.prototype=Object.create(Object.getPrototypeOf(e));return n(new r,i)}}},{}],193:[function(e,t,i){"use strict";var n,r="object"==typeof Reflect?Reflect:null,s=r&&"function"==typeof r.apply?r.apply:function(e,t,i){return Function.prototype.apply.call(e,t,i)};n=r&&"function"==typeof r.ownKeys?r.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var a=Number.isNaN||function(e){return e!=e};function o(){o.init.call(this)}t.exports=o,t.exports.once=function(e,t){return new Promise((function(i,n){function r(i){e.removeListener(t,s),n(i)}function s(){"function"==typeof e.removeListener&&e.removeListener("error",r),i([].slice.call(arguments))}v(e,t,s,{once:!0}),"error"!==t&&function(e,t,i){"function"==typeof e.on&&v(e,"error",t,i)}(e,r,{once:!0})}))},o.EventEmitter=o,o.prototype._events=void 0,o.prototype._eventsCount=0,o.prototype._maxListeners=void 0;var c=10;function l(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function u(e){return void 0===e._maxListeners?o.defaultMaxListeners:e._maxListeners}function p(e,t,i,n){var r,s,a,o;if(l(i),void 0===(s=e._events)?(s=e._events=Object.create(null),e._eventsCount=0):(void 0!==s.newListener&&(e.emit("newListener",t,i.listener?i.listener:i),s=e._events),a=s[t]),void 0===a)a=s[t]=i,++e._eventsCount;else if("function"==typeof a?a=s[t]=n?[i,a]:[a,i]:n?a.unshift(i):a.push(i),(r=u(e))>0&&a.length>r&&!a.warned){a.warned=!0;var c=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");c.name="MaxListenersExceededWarning",c.emitter=e,c.type=t,c.count=a.length,o=c,console&&console.warn&&console.warn(o)}return e}function d(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function f(e,t,i){var n={fired:!1,wrapFn:void 0,target:e,type:t,listener:i},r=d.bind(n);return r.listener=i,n.wrapFn=r,r}function h(e,t,i){var n=e._events;if(void 0===n)return[];var r=n[t];return void 0===r?[]:"function"==typeof r?i?[r.listener||r]:[r]:i?function(e){for(var t=new Array(e.length),i=0;i0&&(a=t[0]),a instanceof Error)throw a;var o=new Error("Unhandled error."+(a?" ("+a.message+")":""));throw o.context=a,o}var c=r[e];if(void 0===c)return!1;if("function"==typeof c)s(c,this,t);else{var l=c.length,u=b(c,l);for(i=0;i=0;s--)if(i[s]===t||i[s].listener===t){a=i[s].listener,r=s;break}if(r<0)return this;0===r?i.shift():function(e,t){for(;t+1=0;n--)this.removeListener(e,t[n]);return this},o.prototype.listeners=function(e){return h(this,e,!0)},o.prototype.rawListeners=function(e){return h(this,e,!1)},o.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):m.call(e,t)},o.prototype.listenerCount=m,o.prototype.eventNames=function(){return this._eventsCount>0?n(this._events):[]}},{}],194:[function(e,t,i){var n=e("safe-buffer").Buffer,r=e("md5.js");t.exports=function(e,t,i,s){if(n.isBuffer(e)||(e=n.from(e,"binary")),t&&(n.isBuffer(t)||(t=n.from(t,"binary")),8!==t.length))throw new RangeError("salt should be Buffer with 8 byte length");for(var a=i/8,o=n.alloc(a),c=n.alloc(s||0),l=n.alloc(0);a>0||s>0;){var u=new r;u.update(l),u.update(e),t&&u.update(t),l=u.digest();var p=0;if(a>0){var d=o.length-a;p=Math.min(a,l.length),l.copy(o,d,0,p),a-=p}if(p0){var f=c.length-s,h=Math.min(s,l.length-p);l.copy(c,f,p,p+h),s-=h}}return l.fill(0),{key:o,iv:c}}},{"md5.js":258,"safe-buffer":383}],195:[function(e,t,i){t.exports=class{constructor(e){if(!(e>0)||0!=(e-1&e))throw new Error("Max size for a FixedFIFO should be a power of two");this.buffer=new Array(e),this.mask=e-1,this.top=0,this.btm=0,this.next=null}push(e){return void 0===this.buffer[this.top]&&(this.buffer[this.top]=e,this.top=this.top+1&this.mask,!0)}shift(){const e=this.buffer[this.btm];if(void 0!==e)return this.buffer[this.btm]=void 0,this.btm=this.btm+1&this.mask,e}isEmpty(){return void 0===this.buffer[this.btm]}}},{}],196:[function(e,t,i){const n=e("./fixed-size");t.exports=class{constructor(e){this.hwm=e||16,this.head=new n(this.hwm),this.tail=this.head}push(e){if(!this.head.push(e)){const t=this.head;this.head=t.next=new n(2*this.head.buffer.length),this.head.push(e)}}shift(){const e=this.tail.shift();if(void 0===e&&this.tail.next){const e=this.tail.next;return this.tail.next=null,this.tail=e,this.tail.shift()}return e}isEmpty(){return this.head.isEmpty()}}},{"./fixed-size":195}],197:[function(e,t,i){arguments[4][29][0].apply(i,arguments)},{dup:29}],198:[function(e,t,i){arguments[4][30][0].apply(i,arguments)},{"./_stream_readable":200,"./_stream_writable":202,_process:341,dup:30,inherits:246}],199:[function(e,t,i){arguments[4][31][0].apply(i,arguments)},{"./_stream_transform":201,dup:31,inherits:246}],200:[function(e,t,i){arguments[4][32][0].apply(i,arguments)},{"../errors":197,"./_stream_duplex":198,"./internal/streams/async_iterator":203,"./internal/streams/buffer_list":204,"./internal/streams/destroy":205,"./internal/streams/from":207,"./internal/streams/state":209,"./internal/streams/stream":210,_process:341,buffer:110,dup:32,events:193,inherits:246,"string_decoder/":472,util:67}],201:[function(e,t,i){arguments[4][33][0].apply(i,arguments)},{"../errors":197,"./_stream_duplex":198,dup:33,inherits:246}],202:[function(e,t,i){arguments[4][34][0].apply(i,arguments)},{"../errors":197,"./_stream_duplex":198,"./internal/streams/destroy":205,"./internal/streams/state":209,"./internal/streams/stream":210,_process:341,buffer:110,dup:34,inherits:246,"util-deprecate":485}],203:[function(e,t,i){arguments[4][35][0].apply(i,arguments)},{"./end-of-stream":206,_process:341,dup:35}],204:[function(e,t,i){arguments[4][36][0].apply(i,arguments)},{buffer:110,dup:36,util:67}],205:[function(e,t,i){arguments[4][37][0].apply(i,arguments)},{_process:341,dup:37}],206:[function(e,t,i){arguments[4][38][0].apply(i,arguments)},{"../../../errors":197,dup:38}],207:[function(e,t,i){arguments[4][39][0].apply(i,arguments)},{dup:39}],208:[function(e,t,i){arguments[4][40][0].apply(i,arguments)},{"../../../errors":197,"./end-of-stream":206,dup:40}],209:[function(e,t,i){arguments[4][41][0].apply(i,arguments)},{"../../../errors":197,dup:41}],210:[function(e,t,i){arguments[4][42][0].apply(i,arguments)},{dup:42,events:193}],211:[function(e,t,i){arguments[4][43][0].apply(i,arguments)},{"./lib/_stream_duplex.js":198,"./lib/_stream_passthrough.js":199,"./lib/_stream_readable.js":200,"./lib/_stream_transform.js":201,"./lib/_stream_writable.js":202,"./lib/internal/streams/end-of-stream.js":206,"./lib/internal/streams/pipeline.js":208,dup:43}],212:[function(e,t,i){const{Readable:n}=e("readable-stream"),r=e("typedarray-to-buffer");t.exports=class extends n{constructor(e,t={}){super(t),this._offset=0,this._ready=!1,this._file=e,this._size=e.size,this._chunkSize=t.chunkSize||Math.max(this._size/1e3,204800);const i=new FileReader;i.onload=()=>{this.push(r(i.result))},i.onerror=()=>{this.emit("error",i.error)},this.reader=i,this._generateHeaderBlocks(e,t,((e,t)=>{if(e)return this.emit("error",e);Array.isArray(t)&&t.forEach((e=>this.push(e))),this._ready=!0,this.emit("_ready")}))}_generateHeaderBlocks(e,t,i){i(null,[])}_read(){if(!this._ready)return void this.once("_ready",this._read.bind(this));const e=this._offset;let t=this._offset+this._chunkSize;if(t>this._size&&(t=this._size),e===this._size)return this.destroy(),void this.push(null);this.reader.readAsArrayBuffer(this._file.slice(e,t)),this._offset=t}destroy(){if(this._file=null,this.reader){this.reader.onload=null,this.reader.onerror=null;try{this.reader.abort()}catch(e){}}this.reader=null}}},{"readable-stream":211,"typedarray-to-buffer":479}],213:[function(e,t,i){t.exports=function(){if("undefined"==typeof globalThis)return null;var e={RTCPeerConnection:globalThis.RTCPeerConnection||globalThis.mozRTCPeerConnection||globalThis.webkitRTCPeerConnection,RTCSessionDescription:globalThis.RTCSessionDescription||globalThis.mozRTCSessionDescription||globalThis.webkitRTCSessionDescription,RTCIceCandidate:globalThis.RTCIceCandidate||globalThis.mozRTCIceCandidate||globalThis.webkitRTCIceCandidate};return e.RTCPeerConnection?e:null}},{}],214:[function(e,t,i){"use strict";var n=e("safe-buffer").Buffer,r=e("readable-stream").Transform;function s(e){r.call(this),this._block=n.allocUnsafe(e),this._blockSize=e,this._blockOffset=0,this._length=[0,0,0,0],this._finalized=!1}e("inherits")(s,r),s.prototype._transform=function(e,t,i){var n=null;try{this.update(e,t)}catch(e){n=e}i(n)},s.prototype._flush=function(e){var t=null;try{this.push(this.digest())}catch(e){t=e}e(t)},s.prototype.update=function(e,t){if(function(e,t){if(!n.isBuffer(e)&&"string"!=typeof e)throw new TypeError(t+" must be a string or a buffer")}(e,"Data"),this._finalized)throw new Error("Digest already called");n.isBuffer(e)||(e=n.from(e,t));for(var i=this._block,r=0;this._blockOffset+e.length-r>=this._blockSize;){for(var s=this._blockOffset;s0;++a)this._length[a]+=o,(o=this._length[a]/4294967296|0)>0&&(this._length[a]-=4294967296*o);return this},s.prototype._update=function(){throw new Error("_update is not implemented")},s.prototype.digest=function(e){if(this._finalized)throw new Error("Digest already called");this._finalized=!0;var t=this._digest();void 0!==e&&(t=t.toString(e)),this._block.fill(0),this._blockOffset=0;for(var i=0;i<4;++i)this._length[i]=0;return t},s.prototype._digest=function(){throw new Error("_digest is not implemented")},t.exports=s},{inherits:246,"readable-stream":229,"safe-buffer":383}],215:[function(e,t,i){arguments[4][29][0].apply(i,arguments)},{dup:29}],216:[function(e,t,i){arguments[4][30][0].apply(i,arguments)},{"./_stream_readable":218,"./_stream_writable":220,_process:341,dup:30,inherits:246}],217:[function(e,t,i){arguments[4][31][0].apply(i,arguments)},{"./_stream_transform":219,dup:31,inherits:246}],218:[function(e,t,i){arguments[4][32][0].apply(i,arguments)},{"../errors":215,"./_stream_duplex":216,"./internal/streams/async_iterator":221,"./internal/streams/buffer_list":222,"./internal/streams/destroy":223,"./internal/streams/from":225,"./internal/streams/state":227,"./internal/streams/stream":228,_process:341,buffer:110,dup:32,events:193,inherits:246,"string_decoder/":472,util:67}],219:[function(e,t,i){arguments[4][33][0].apply(i,arguments)},{"../errors":215,"./_stream_duplex":216,dup:33,inherits:246}],220:[function(e,t,i){arguments[4][34][0].apply(i,arguments)},{"../errors":215,"./_stream_duplex":216,"./internal/streams/destroy":223,"./internal/streams/state":227,"./internal/streams/stream":228,_process:341,buffer:110,dup:34,inherits:246,"util-deprecate":485}],221:[function(e,t,i){arguments[4][35][0].apply(i,arguments)},{"./end-of-stream":224,_process:341,dup:35}],222:[function(e,t,i){arguments[4][36][0].apply(i,arguments)},{buffer:110,dup:36,util:67}],223:[function(e,t,i){arguments[4][37][0].apply(i,arguments)},{_process:341,dup:37}],224:[function(e,t,i){arguments[4][38][0].apply(i,arguments)},{"../../../errors":215,dup:38}],225:[function(e,t,i){arguments[4][39][0].apply(i,arguments)},{dup:39}],226:[function(e,t,i){arguments[4][40][0].apply(i,arguments)},{"../../../errors":215,"./end-of-stream":224,dup:40}],227:[function(e,t,i){arguments[4][41][0].apply(i,arguments)},{"../../../errors":215,dup:41}],228:[function(e,t,i){arguments[4][42][0].apply(i,arguments)},{dup:42,events:193}],229:[function(e,t,i){arguments[4][43][0].apply(i,arguments)},{"./lib/_stream_duplex.js":216,"./lib/_stream_passthrough.js":217,"./lib/_stream_readable.js":218,"./lib/_stream_transform.js":219,"./lib/_stream_writable.js":220,"./lib/internal/streams/end-of-stream.js":224,"./lib/internal/streams/pipeline.js":226,dup:43}],230:[function(e,t,i){var n=i;n.utils=e("./hash/utils"),n.common=e("./hash/common"),n.sha=e("./hash/sha"),n.ripemd=e("./hash/ripemd"),n.hmac=e("./hash/hmac"),n.sha1=n.sha.sha1,n.sha256=n.sha.sha256,n.sha224=n.sha.sha224,n.sha384=n.sha.sha384,n.sha512=n.sha.sha512,n.ripemd160=n.ripemd.ripemd160},{"./hash/common":231,"./hash/hmac":232,"./hash/ripemd":233,"./hash/sha":234,"./hash/utils":241}],231:[function(e,t,i){"use strict";var n=e("./utils"),r=e("minimalistic-assert");function s(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}i.BlockHash=s,s.prototype.update=function(e,t){if(e=n.toArray(e,t),this.pending?this.pending=this.pending.concat(e):this.pending=e,this.pendingTotal+=e.length,this.pending.length>=this._delta8){var i=(e=this.pending).length%this._delta8;this.pending=e.slice(e.length-i,e.length),0===this.pending.length&&(this.pending=null),e=n.join32(e,0,e.length-i,this.endian);for(var r=0;r>>24&255,n[r++]=e>>>16&255,n[r++]=e>>>8&255,n[r++]=255&e}else for(n[r++]=255&e,n[r++]=e>>>8&255,n[r++]=e>>>16&255,n[r++]=e>>>24&255,n[r++]=0,n[r++]=0,n[r++]=0,n[r++]=0,s=8;sthis.blockSize&&(e=(new this.Hash).update(e).digest()),r(e.length<=this.blockSize);for(var t=e.length;t>>3},i.g1_256=function(e){return n(e,17)^n(e,19)^e>>>10}},{"../utils":241}],241:[function(e,t,i){"use strict";var n=e("minimalistic-assert"),r=e("inherits");function s(e,t){return 55296==(64512&e.charCodeAt(t))&&(!(t<0||t+1>=e.length)&&56320==(64512&e.charCodeAt(t+1)))}function a(e){return(e>>>24|e>>>8&65280|e<<8&16711680|(255&e)<<24)>>>0}function o(e){return 1===e.length?"0"+e:e}function c(e){return 7===e.length?"0"+e:6===e.length?"00"+e:5===e.length?"000"+e:4===e.length?"0000"+e:3===e.length?"00000"+e:2===e.length?"000000"+e:1===e.length?"0000000"+e:e}i.inherits=r,i.toArray=function(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var i=[];if("string"==typeof e)if(t){if("hex"===t)for((e=e.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(e="0"+e),r=0;r>6|192,i[n++]=63&a|128):s(e,r)?(a=65536+((1023&a)<<10)+(1023&e.charCodeAt(++r)),i[n++]=a>>18|240,i[n++]=a>>12&63|128,i[n++]=a>>6&63|128,i[n++]=63&a|128):(i[n++]=a>>12|224,i[n++]=a>>6&63|128,i[n++]=63&a|128)}else for(r=0;r>>0}return a},i.split32=function(e,t){for(var i=new Array(4*e.length),n=0,r=0;n>>24,i[r+1]=s>>>16&255,i[r+2]=s>>>8&255,i[r+3]=255&s):(i[r+3]=s>>>24,i[r+2]=s>>>16&255,i[r+1]=s>>>8&255,i[r]=255&s)}return i},i.rotr32=function(e,t){return e>>>t|e<<32-t},i.rotl32=function(e,t){return e<>>32-t},i.sum32=function(e,t){return e+t>>>0},i.sum32_3=function(e,t,i){return e+t+i>>>0},i.sum32_4=function(e,t,i,n){return e+t+i+n>>>0},i.sum32_5=function(e,t,i,n,r){return e+t+i+n+r>>>0},i.sum64=function(e,t,i,n){var r=e[t],s=n+e[t+1]>>>0,a=(s>>0,e[t+1]=s},i.sum64_hi=function(e,t,i,n){return(t+n>>>0>>0},i.sum64_lo=function(e,t,i,n){return t+n>>>0},i.sum64_4_hi=function(e,t,i,n,r,s,a,o){var c=0,l=t;return c+=(l=l+n>>>0)>>0)>>0)>>0},i.sum64_4_lo=function(e,t,i,n,r,s,a,o){return t+n+s+o>>>0},i.sum64_5_hi=function(e,t,i,n,r,s,a,o,c,l){var u=0,p=t;return u+=(p=p+n>>>0)>>0)>>0)>>0)>>0},i.sum64_5_lo=function(e,t,i,n,r,s,a,o,c,l){return t+n+s+o+l>>>0},i.rotr64_hi=function(e,t,i){return(t<<32-i|e>>>i)>>>0},i.rotr64_lo=function(e,t,i){return(e<<32-i|t>>>i)>>>0},i.shr64_hi=function(e,t,i){return e>>>i},i.shr64_lo=function(e,t,i){return(e<<32-i|t>>>i)>>>0}},{inherits:246,"minimalistic-assert":285}],242:[function(e,t,i){"use strict";var n=e("hash.js"),r=e("minimalistic-crypto-utils"),s=e("minimalistic-assert");function a(e){if(!(this instanceof a))return new a(e);this.hash=e.hash,this.predResist=!!e.predResist,this.outLen=this.hash.outSize,this.minEntropy=e.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var t=r.toArray(e.entropy,e.entropyEnc||"hex"),i=r.toArray(e.nonce,e.nonceEnc||"hex"),n=r.toArray(e.pers,e.persEnc||"hex");s(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(t,i,n)}t.exports=a,a.prototype._init=function(e,t,i){var n=e.concat(t).concat(i);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var r=0;r=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(i||[])),this._reseed=1},a.prototype.generate=function(e,t,i,n){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof t&&(n=i,i=t,t=null),i&&(i=r.toArray(i,n||"hex"),this._update(i));for(var s=[];s.length */ -n.read=function(e,t,n,i,r){var s,o,a=8*r-i-1,c=(1<>1,l=-7,d=n?r-1:0,f=n?-1:1,p=e[t+d];for(d+=f,s=p&(1<<-l)-1,p>>=-l,l+=a;l>0;s=256*s+e[t+d],d+=f,l-=8);for(o=s&(1<<-l)-1,s>>=-l,l+=i;l>0;o=256*o+e[t+d],d+=f,l-=8);if(0===s)s=1-u;else{if(s===c)return o?NaN:1/0*(p?-1:1);o+=Math.pow(2,i),s-=u}return(p?-1:1)*o*Math.pow(2,s-i)},n.write=function(e,t,n,i,r,s){var o,a,c,u=8*s-r-1,l=(1<>1,f=23===r?Math.pow(2,-24)-Math.pow(2,-77):0,p=i?0:s-1,h=i?1:-1,m=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,o=l):(o=Math.floor(Math.log(t)/Math.LN2),t*(c=Math.pow(2,-o))<1&&(o--,c*=2),(t+=o+d>=1?f/c:f*Math.pow(2,1-d))*c>=2&&(o++,c/=2),o+d>=l?(a=0,o=l):o+d>=1?(a=(t*c-1)*Math.pow(2,r),o+=d):(a=t*Math.pow(2,d-1)*Math.pow(2,r),o=0));r>=8;e[n+p]=255&a,p+=h,a/=256,r-=8);for(o=o<0;e[n+p]=255&o,p+=h,o/=256,u-=8);e[n+p-h]|=128*m}},{}],248:[function(e,t,n){ +i.read=function(e,t,i,n,r){var s,a,o=8*r-n-1,c=(1<>1,u=-7,p=i?r-1:0,d=i?-1:1,f=e[t+p];for(p+=d,s=f&(1<<-u)-1,f>>=-u,u+=o;u>0;s=256*s+e[t+p],p+=d,u-=8);for(a=s&(1<<-u)-1,s>>=-u,u+=n;u>0;a=256*a+e[t+p],p+=d,u-=8);if(0===s)s=1-l;else{if(s===c)return a?NaN:1/0*(f?-1:1);a+=Math.pow(2,n),s-=l}return(f?-1:1)*a*Math.pow(2,s-n)},i.write=function(e,t,i,n,r,s){var a,o,c,l=8*s-r-1,u=(1<>1,d=23===r?Math.pow(2,-24)-Math.pow(2,-77):0,f=n?0:s-1,h=n?1:-1,m=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(o=isNaN(t)?1:0,a=u):(a=Math.floor(Math.log(t)/Math.LN2),t*(c=Math.pow(2,-a))<1&&(a--,c*=2),(t+=a+p>=1?d/c:d*Math.pow(2,1-p))*c>=2&&(a++,c/=2),a+p>=u?(o=0,a=u):a+p>=1?(o=(t*c-1)*Math.pow(2,r),a+=p):(o=t*Math.pow(2,p-1)*Math.pow(2,r),a=0));r>=8;e[i+f]=255&o,f+=h,o/=256,r-=8);for(a=a<0;e[i+f]=255&a,f+=h,a/=256,l-=8);e[i+f-h]|=128*m}},{}],245:[function(e,t,i){ /*! immediate-chunk-store. MIT License. Feross Aboukhadijeh */ -const i=e("queue-microtask");t.exports=class{constructor(e){if(this.store=e,this.chunkLength=e.chunkLength,!this.store||!this.store.get||!this.store.put)throw new Error("First argument must be abstract-chunk-store compliant");this.mem=[]}put(e,t,n=(()=>{})){this.mem[e]=t,this.store.put(e,t,(t=>{this.mem[e]=null,n(t)}))}get(e,t,n=(()=>{})){if("function"==typeof t)return this.get(e,null,t);let r=this.mem[e];if(!r)return this.store.get(e,t,n);t||(t={});const s=t.offset||0,o=t.length||r.length-s;0===s&&o===r.length||(r=r.slice(s,o+s)),i((()=>n(null,r)))}close(e=(()=>{})){this.store.close(e)}destroy(e=(()=>{})){this.store.destroy(e)}}},{"queue-microtask":355}],249:[function(e,t,n){"function"==typeof Object.create?t.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:t.exports=function(e,t){if(t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}}},{}],250:[function(e,t,n){t.exports=function(e){for(var t=0,n=e.length;t127)return!1;return!0}},{}],251:[function(e,t,n){function i(e){return!!e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)} +const n=e("queue-microtask");t.exports=class{constructor(e){if(this.store=e,this.chunkLength=e.chunkLength,!this.store||!this.store.get||!this.store.put)throw new Error("First argument must be abstract-chunk-store compliant");this.mem=[]}put(e,t,i=(()=>{})){this.mem[e]=t,this.store.put(e,t,(t=>{this.mem[e]=null,i(t)}))}get(e,t,i=(()=>{})){if("function"==typeof t)return this.get(e,null,t);let r=this.mem[e];if(!r)return this.store.get(e,t,i);t||(t={});const s=t.offset||0,a=t.length||r.length-s;0===s&&a===r.length||(r=r.slice(s,a+s)),n((()=>i(null,r)))}close(e=(()=>{})){this.store.close(e)}destroy(e=(()=>{})){this.store.destroy(e)}}},{"queue-microtask":354}],246:[function(e,t,i){"function"==typeof Object.create?t.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:t.exports=function(e,t){if(t){e.super_=t;var i=function(){};i.prototype=t.prototype,e.prototype=new i,e.prototype.constructor=e}}},{}],247:[function(e,t,i){t.exports=function(e){for(var t=0,i=e.length;t127)return!1;return!0}},{}],248:[function(e,t,i){function n(e){return!!e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)} /*! * Determine if an object is a Buffer * * @author Feross Aboukhadijeh * @license MIT */ -t.exports=function(e){return null!=e&&(i(e)||function(e){return"function"==typeof e.readFloatLE&&"function"==typeof e.slice&&i(e.slice(0,0))}(e)||!!e._isBuffer)}},{}],252:[function(e,t,n){t.exports=s,s.strict=o,s.loose=a;var i=Object.prototype.toString,r={"[object Int8Array]":!0,"[object Int16Array]":!0,"[object Int32Array]":!0,"[object Uint8Array]":!0,"[object Uint8ClampedArray]":!0,"[object Uint16Array]":!0,"[object Uint32Array]":!0,"[object Float32Array]":!0,"[object Float64Array]":!0};function s(e){return o(e)||a(e)}function o(e){return e instanceof Int8Array||e instanceof Int16Array||e instanceof Int32Array||e instanceof Uint8Array||e instanceof Uint8ClampedArray||e instanceof Uint16Array||e instanceof Uint32Array||e instanceof Float32Array||e instanceof Float64Array}function a(e){return r[i.call(e)]}},{}],253:[function(e,t,n){"use strict";n.re=()=>{throw new Error("`junk.re` was renamed to `junk.regex`")},n.regex=new RegExp(["^npm-debug\\.log$","^\\..*\\.swp$","^\\.DS_Store$","^\\.AppleDouble$","^\\.LSOverride$","^Icon\\r$","^\\._.*","^\\.Spotlight-V100(?:$|\\/)","\\.Trashes","^__MACOSX$","~$","^Thumbs\\.db$","^ehthumbs\\.db$","^Desktop\\.ini$","@eaDir$"].join("|")),n.is=e=>n.regex.test(e),n.not=e=>!n.is(e),n.default=t.exports},{}],254:[function(e,t,n){n.RateLimiter=e("./lib/rateLimiter"),n.TokenBucket=e("./lib/tokenBucket")},{"./lib/rateLimiter":256,"./lib/tokenBucket":257}],255:[function(e,t,n){(function(e){(function(){t.exports=function(){if(void 0!==e&&e.hrtime){var t=e.hrtime(),n=t[0],i=t[1];return 1e3*n+Math.floor(i/1e6)}return(new Date).getTime()}}).call(this)}).call(this,e("_process"))},{_process:342}],256:[function(e,t,n){(function(n){(function(){var i=e("./tokenBucket"),r=e("./clock"),s=function(e,t,n){this.tokenBucket=new i(e,e,t,null),this.tokenBucket.content=e,this.curIntervalStart=r(),this.tokensThisInterval=0,this.fireImmediately=n};s.prototype={tokenBucket:null,curIntervalStart:0,tokensThisInterval:0,fireImmediately:!1,removeTokens:function(e,t){if(e>this.tokenBucket.bucketSize)return n.nextTick(t.bind(null,"Requested tokens "+e+" exceeds maximum tokens per interval "+this.tokenBucket.bucketSize,null)),!1;var i=this,s=r();if((s=this.tokenBucket.interval)&&(this.curIntervalStart=s,this.tokensThisInterval=0),e>this.tokenBucket.tokensPerInterval-this.tokensThisInterval){if(this.fireImmediately)n.nextTick(t.bind(null,null,-1));else{var o=Math.ceil(this.curIntervalStart+this.tokenBucket.interval-s);setTimeout((function(){i.tokenBucket.removeTokens(e,a)}),o)}return!1}return this.tokenBucket.removeTokens(e,a);function a(n,r){if(n)return t(n,null);i.tokensThisInterval+=e,t(null,r)}},tryRemoveTokens:function(e){if(e>this.tokenBucket.bucketSize)return!1;var t=r();if((t=this.tokenBucket.interval)&&(this.curIntervalStart=t,this.tokensThisInterval=0),e>this.tokenBucket.tokensPerInterval-this.tokensThisInterval)return!1;var n=this.tokenBucket.tryRemoveTokens(e);return n&&(this.tokensThisInterval+=e),n},getTokensRemaining:function(){return this.tokenBucket.drip(),this.tokenBucket.content}},t.exports=s}).call(this)}).call(this,e("_process"))},{"./clock":255,"./tokenBucket":257,_process:342}],257:[function(e,t,n){(function(e){(function(){var n=function(e,t,n,i){if(this.bucketSize=e,this.tokensPerInterval=t,"string"==typeof n)switch(n){case"sec":case"second":this.interval=1e3;break;case"min":case"minute":this.interval=6e4;break;case"hr":case"hour":this.interval=36e5;break;case"day":this.interval=864e5;break;default:throw new Error("Invaid interval "+n)}else this.interval=n;this.parentBucket=i,this.content=0,this.lastDrip=+new Date};n.prototype={bucketSize:1,tokensPerInterval:1,interval:1e3,parentBucket:null,content:0,lastDrip:0,removeTokens:function(t,n){var i=this;return this.bucketSize?t>this.bucketSize?(e.nextTick(n.bind(null,"Requested tokens "+t+" exceeds bucket size "+this.bucketSize,null)),!1):(this.drip(),t>this.content?r():this.parentBucket?this.parentBucket.removeTokens(t,(function(e,s){return e?n(e,null):t>i.content?r():(i.content-=t,void n(null,Math.min(s,i.content)))})):(this.content-=t,e.nextTick(n.bind(null,null,this.content)),!0)):(e.nextTick(n.bind(null,null,t,Number.POSITIVE_INFINITY)),!0);function r(){var e=Math.ceil((t-i.content)*(i.interval/i.tokensPerInterval));return setTimeout((function(){i.removeTokens(t,n)}),e),!1}},tryRemoveTokens:function(e){return!this.bucketSize||!(e>this.bucketSize)&&(this.drip(),!(e>this.content)&&(!(this.parentBucket&&!this.parentBucket.tryRemoveTokens(e))&&(this.content-=e,!0)))},drip:function(){if(this.tokensPerInterval){var e=+new Date,t=Math.max(e-this.lastDrip,0);this.lastDrip=e;var n=t*(this.tokensPerInterval/this.interval);this.content=Math.min(this.content+n,this.bucketSize)}else this.content=this.bucketSize}},t.exports=n}).call(this)}).call(this,e("_process"))},{_process:342}],258:[function(e,t,n){var i=e("events"),r=e("inherits");function s(e){if(!(this instanceof s))return new s(e);"number"==typeof e&&(e={max:e}),e||(e={}),i.EventEmitter.call(this),this.cache={},this.head=this.tail=null,this.length=0,this.max=e.max||1e3,this.maxAge=e.maxAge||0}t.exports=s,r(s,i.EventEmitter),Object.defineProperty(s.prototype,"keys",{get:function(){return Object.keys(this.cache)}}),s.prototype.clear=function(){this.cache={},this.head=this.tail=null,this.length=0},s.prototype.remove=function(e){if("string"!=typeof e&&(e=""+e),this.cache.hasOwnProperty(e)){var t=this.cache[e];return delete this.cache[e],this._unlink(e,t.prev,t.next),t.value}},s.prototype._unlink=function(e,t,n){this.length--,0===this.length?this.head=this.tail=null:this.head===e?(this.head=t,this.cache[this.head].next=null):this.tail===e?(this.tail=n,this.cache[this.tail].prev=null):(this.cache[t].next=n,this.cache[n].prev=t)},s.prototype.peek=function(e){if(this.cache.hasOwnProperty(e)){var t=this.cache[e];if(this._checkAge(e,t))return t.value}},s.prototype.set=function(e,t){var n;if("string"!=typeof e&&(e=""+e),this.cache.hasOwnProperty(e)){if((n=this.cache[e]).value=t,this.maxAge&&(n.modified=Date.now()),e===this.head)return t;this._unlink(e,n.prev,n.next)}else n={value:t,modified:0,next:null,prev:null},this.maxAge&&(n.modified=Date.now()),this.cache[e]=n,this.length===this.max&&this.evict();return this.length++,n.next=null,n.prev=this.head,this.head&&(this.cache[this.head].next=e),this.head=e,this.tail||(this.tail=e),t},s.prototype._checkAge=function(e,t){return!(this.maxAge&&Date.now()-t.modified>this.maxAge)||(this.remove(e),this.emit("evict",{key:e,value:t.value}),!1)},s.prototype.get=function(e){if("string"!=typeof e&&(e=""+e),this.cache.hasOwnProperty(e)){var t=this.cache[e];if(this._checkAge(e,t))return this.head!==e&&(e===this.tail?(this.tail=t.next,this.cache[this.tail].prev=null):this.cache[t.prev].next=t.next,this.cache[t.next].prev=t.prev,this.cache[this.head].next=e,t.prev=this.head,t.next=null,this.head=e),t.value}},s.prototype.evict=function(){if(this.tail){var e=this.tail,t=this.remove(this.tail);this.emit("evict",{key:e,value:t})}}},{events:196,inherits:249}],259:[function(e,t,n){(function(n){(function(){ +t.exports=function(e){return null!=e&&(n(e)||function(e){return"function"==typeof e.readFloatLE&&"function"==typeof e.slice&&n(e.slice(0,0))}(e)||!!e._isBuffer)}},{}],249:[function(e,t,i){t.exports=s,s.strict=a,s.loose=o;var n=Object.prototype.toString,r={"[object Int8Array]":!0,"[object Int16Array]":!0,"[object Int32Array]":!0,"[object Uint8Array]":!0,"[object Uint8ClampedArray]":!0,"[object Uint16Array]":!0,"[object Uint32Array]":!0,"[object Float32Array]":!0,"[object Float64Array]":!0};function s(e){return a(e)||o(e)}function a(e){return e instanceof Int8Array||e instanceof Int16Array||e instanceof Int32Array||e instanceof Uint8Array||e instanceof Uint8ClampedArray||e instanceof Uint16Array||e instanceof Uint32Array||e instanceof Float32Array||e instanceof Float64Array}function o(e){return r[n.call(e)]}},{}],250:[function(e,t,i){"use strict";i.re=()=>{throw new Error("`junk.re` was renamed to `junk.regex`")},i.regex=new RegExp(["^npm-debug\\.log$","^\\..*\\.swp$","^\\.DS_Store$","^\\.AppleDouble$","^\\.LSOverride$","^Icon\\r$","^\\._.*","^\\.Spotlight-V100(?:$|\\/)","\\.Trashes","^__MACOSX$","~$","^Thumbs\\.db$","^ehthumbs\\.db$","^Desktop\\.ini$","@eaDir$"].join("|")),i.is=e=>i.regex.test(e),i.not=e=>!i.is(e),i.default=t.exports},{}],251:[function(e,t,i){i.RateLimiter=e("./lib/rateLimiter"),i.TokenBucket=e("./lib/tokenBucket")},{"./lib/rateLimiter":253,"./lib/tokenBucket":254}],252:[function(e,t,i){(function(e){(function(){t.exports=function(){if(void 0!==e&&e.hrtime){var t=e.hrtime(),i=t[0],n=t[1];return 1e3*i+Math.floor(n/1e6)}return(new Date).getTime()}}).call(this)}).call(this,e("_process"))},{_process:341}],253:[function(e,t,i){(function(i){(function(){var n=e("./tokenBucket"),r=e("./clock"),s=function(e,t,i){this.tokenBucket=new n(e,e,t,null),this.tokenBucket.content=e,this.curIntervalStart=r(),this.tokensThisInterval=0,this.fireImmediately=i};s.prototype={tokenBucket:null,curIntervalStart:0,tokensThisInterval:0,fireImmediately:!1,removeTokens:function(e,t){if(e>this.tokenBucket.bucketSize)return i.nextTick(t.bind(null,"Requested tokens "+e+" exceeds maximum tokens per interval "+this.tokenBucket.bucketSize,null)),!1;var n=this,s=r();if((s=this.tokenBucket.interval)&&(this.curIntervalStart=s,this.tokensThisInterval=0),e>this.tokenBucket.tokensPerInterval-this.tokensThisInterval){if(this.fireImmediately)i.nextTick(t.bind(null,null,-1));else{var a=Math.ceil(this.curIntervalStart+this.tokenBucket.interval-s);setTimeout((function(){n.tokenBucket.removeTokens(e,o)}),a)}return!1}return this.tokenBucket.removeTokens(e,o);function o(i,r){if(i)return t(i,null);n.tokensThisInterval+=e,t(null,r)}},tryRemoveTokens:function(e){if(e>this.tokenBucket.bucketSize)return!1;var t=r();if((t=this.tokenBucket.interval)&&(this.curIntervalStart=t,this.tokensThisInterval=0),e>this.tokenBucket.tokensPerInterval-this.tokensThisInterval)return!1;var i=this.tokenBucket.tryRemoveTokens(e);return i&&(this.tokensThisInterval+=e),i},getTokensRemaining:function(){return this.tokenBucket.drip(),this.tokenBucket.content}},t.exports=s}).call(this)}).call(this,e("_process"))},{"./clock":252,"./tokenBucket":254,_process:341}],254:[function(e,t,i){(function(e){(function(){var i=function(e,t,i,n){if(this.bucketSize=e,this.tokensPerInterval=t,"string"==typeof i)switch(i){case"sec":case"second":this.interval=1e3;break;case"min":case"minute":this.interval=6e4;break;case"hr":case"hour":this.interval=36e5;break;case"day":this.interval=864e5;break;default:throw new Error("Invaid interval "+i)}else this.interval=i;this.parentBucket=n,this.content=0,this.lastDrip=+new Date};i.prototype={bucketSize:1,tokensPerInterval:1,interval:1e3,parentBucket:null,content:0,lastDrip:0,removeTokens:function(t,i){var n=this;return this.bucketSize?t>this.bucketSize?(e.nextTick(i.bind(null,"Requested tokens "+t+" exceeds bucket size "+this.bucketSize,null)),!1):(this.drip(),t>this.content?r():this.parentBucket?this.parentBucket.removeTokens(t,(function(e,s){return e?i(e,null):t>n.content?r():(n.content-=t,void i(null,Math.min(s,n.content)))})):(this.content-=t,e.nextTick(i.bind(null,null,this.content)),!0)):(e.nextTick(i.bind(null,null,t,Number.POSITIVE_INFINITY)),!0);function r(){var e=Math.ceil((t-n.content)*(n.interval/n.tokensPerInterval));return setTimeout((function(){n.removeTokens(t,i)}),e),!1}},tryRemoveTokens:function(e){return!this.bucketSize||!(e>this.bucketSize)&&(this.drip(),!(e>this.content)&&(!(this.parentBucket&&!this.parentBucket.tryRemoveTokens(e))&&(this.content-=e,!0)))},drip:function(){if(this.tokensPerInterval){var e=+new Date,t=Math.max(e-this.lastDrip,0);this.lastDrip=e;var i=t*(this.tokensPerInterval/this.interval);this.content=Math.min(this.content+i,this.bucketSize)}else this.content=this.bucketSize}},t.exports=i}).call(this)}).call(this,e("_process"))},{_process:341}],255:[function(e,t,i){var n=e("events"),r=e("inherits");function s(e){if(!(this instanceof s))return new s(e);"number"==typeof e&&(e={max:e}),e||(e={}),n.EventEmitter.call(this),this.cache={},this.head=this.tail=null,this.length=0,this.max=e.max||1e3,this.maxAge=e.maxAge||0}t.exports=s,r(s,n.EventEmitter),Object.defineProperty(s.prototype,"keys",{get:function(){return Object.keys(this.cache)}}),s.prototype.clear=function(){this.cache={},this.head=this.tail=null,this.length=0},s.prototype.remove=function(e){if("string"!=typeof e&&(e=""+e),this.cache.hasOwnProperty(e)){var t=this.cache[e];return delete this.cache[e],this._unlink(e,t.prev,t.next),t.value}},s.prototype._unlink=function(e,t,i){this.length--,0===this.length?this.head=this.tail=null:this.head===e?(this.head=t,this.cache[this.head].next=null):this.tail===e?(this.tail=i,this.cache[this.tail].prev=null):(this.cache[t].next=i,this.cache[i].prev=t)},s.prototype.peek=function(e){if(this.cache.hasOwnProperty(e)){var t=this.cache[e];if(this._checkAge(e,t))return t.value}},s.prototype.set=function(e,t){var i;if("string"!=typeof e&&(e=""+e),this.cache.hasOwnProperty(e)){if((i=this.cache[e]).value=t,this.maxAge&&(i.modified=Date.now()),e===this.head)return t;this._unlink(e,i.prev,i.next)}else i={value:t,modified:0,next:null,prev:null},this.maxAge&&(i.modified=Date.now()),this.cache[e]=i,this.length===this.max&&this.evict();return this.length++,i.next=null,i.prev=this.head,this.head&&(this.cache[this.head].next=e),this.head=e,this.tail||(this.tail=e),t},s.prototype._checkAge=function(e,t){return!(this.maxAge&&Date.now()-t.modified>this.maxAge)||(this.remove(e),this.emit("evict",{key:e,value:t.value}),!1)},s.prototype.get=function(e){if("string"!=typeof e&&(e=""+e),this.cache.hasOwnProperty(e)){var t=this.cache[e];if(this._checkAge(e,t))return this.head!==e&&(e===this.tail?(this.tail=t.next,this.cache[this.tail].prev=null):this.cache[t.prev].next=t.next,this.cache[t.next].prev=t.prev,this.cache[this.head].next=e,t.prev=this.head,t.next=null,this.head=e),t.value}},s.prototype.evict=function(){if(this.tail){var e=this.tail,t=this.remove(this.tail);this.emit("evict",{key:e,value:t})}}},{events:193,inherits:246}],256:[function(e,t,i){(function(i){(function(){ /*! lt_donthave. MIT License. WebTorrent LLC */ -const i=e("unordered-array-remove"),{EventEmitter:r}=e("events"),s=e("debug")("lt_donthave");t.exports=()=>{class e extends r{constructor(e){super(),this._peerSupports=!1,this._wire=e}onExtendedHandshake(){this._peerSupports=!0}onMessage(e){let t;try{t=e.readUInt32BE()}catch(e){return}this._wire.peerPieces.get(t)&&(s("got donthave %d",t),this._wire.peerPieces.set(t,!1),this.emit("donthave",t),this._failRequests(t))}donthave(e){if(!this._peerSupports)return;s("donthave %d",e);const t=n.alloc(4);t.writeUInt32BE(e),this._wire.extended("lt_donthave",t)}_failRequests(e){const t=this._wire.requests;for(let n=0;n{class e extends r{constructor(e){super(),this._peerSupports=!1,this._wire=e}onExtendedHandshake(){this._peerSupports=!0}onMessage(e){let t;try{t=e.readUInt32BE()}catch(e){return}this._wire.peerPieces.get(t)&&(s("got donthave %d",t),this._wire.peerPieces.set(t,!1),this.emit("donthave",t),this._failRequests(t))}donthave(e){if(!this._peerSupports)return;s("donthave %d",e);const t=i.alloc(4);t.writeUInt32BE(e),this._wire.extended("lt_donthave",t)}_failRequests(e){const t=this._wire.requests;for(let i=0;i */ -t.exports=s,t.exports.decode=s,t.exports.encode=function(e){e=Object.assign({},e);let t=new Set;e.xt&&"string"==typeof e.xt&&t.add(e.xt);e.xt&&Array.isArray(e.xt)&&(t=new Set(e.xt));e.infoHashBuffer&&t.add(`urn:btih:${e.infoHashBuffer.toString("hex")}`);e.infoHash&&t.add(`urn:btih:${e.infoHash}`);e.infoHashV2Buffer&&t.add(e.xt=`urn:btmh:1220${e.infoHashV2Buffer.toString("hex")}`);e.infoHashV2&&t.add(`urn:btmh:1220${e.infoHashV2}`);const n=Array.from(t);1===n.length&&(e.xt=n[0]);n.length>1&&(e.xt=n);e.publicKeyBuffer&&(e.xs=`urn:btpk:${e.publicKeyBuffer.toString("hex")}`);e.publicKey&&(e.xs=`urn:btpk:${e.publicKey}`);e.name&&(e.dn=e.name);e.keywords&&(e.kt=e.keywords);e.announce&&(e.tr=e.announce);e.urlList&&(e.ws=e.urlList,delete e.as);e.peerAddresses&&(e["x.pe"]=e.peerAddresses);let i="magnet:?";return Object.keys(e).filter((e=>2===e.length||"x.pe"===e)).forEach(((t,n)=>{const s=Array.isArray(e[t])?e[t]:[e[t]];s.forEach(((e,r)=>{(n>0||r>0)&&("kt"!==t&&"so"!==t||0===r)&&(i+="&"),"dn"===t&&(e=encodeURIComponent(e).replace(/%20/g,"+")),"tr"!==t&&"as"!==t&&"ws"!==t||(e=encodeURIComponent(e)),"xs"!==t||e.startsWith("urn:btpk:")||(e=encodeURIComponent(e)),"kt"===t&&(e=encodeURIComponent(e)),"so"!==t&&(i+="kt"===t&&r>0?`+${e}`:`${t}=${e}`)})),"so"===t&&(i+=`${t}=${r.compose(s)}`)})),i};const i=e("thirty-two"),r=e("bep53-range");function s(e){const t={},s=e.split("magnet:?")[1];let o;if((s&&s.length>=0?s.split("&"):[]).forEach((e=>{const n=e.split("=");if(2!==n.length)return;const i=n[0];let s=n[1];"dn"===i&&(s=decodeURIComponent(s).replace(/\+/g," ")),"tr"!==i&&"xs"!==i&&"as"!==i&&"ws"!==i||(s=decodeURIComponent(s)),"kt"===i&&(s=decodeURIComponent(s).split("+")),"ix"===i&&(s=Number(s)),"so"===i&&(s=r.parse(decodeURIComponent(s).split(","))),t[i]?(Array.isArray(t[i])||(t[i]=[t[i]]),t[i].push(s)):t[i]=s})),t.xt){(Array.isArray(t.xt)?t.xt:[t.xt]).forEach((e=>{if(o=e.match(/^urn:btih:(.{40})/))t.infoHash=o[1].toLowerCase();else if(o=e.match(/^urn:btih:(.{32})/)){const e=i.decode(o[1]);t.infoHash=n.from(e,"binary").toString("hex")}else(o=e.match(/^urn:btmh:1220(.{64})/))&&(t.infoHashV2=o[1].toLowerCase())}))}if(t.xs){(Array.isArray(t.xs)?t.xs:[t.xs]).forEach((e=>{(o=e.match(/^urn:btpk:(.{64})/))&&(t.publicKey=o[1].toLowerCase())}))}return t.infoHash&&(t.infoHashBuffer=n.from(t.infoHash,"hex")),t.infoHashV2&&(t.infoHashV2Buffer=n.from(t.infoHashV2,"hex")),t.publicKey&&(t.publicKeyBuffer=n.from(t.publicKey,"hex")),t.dn&&(t.name=t.dn),t.kt&&(t.keywords=t.kt),t.announce=[],("string"==typeof t.tr||Array.isArray(t.tr))&&(t.announce=t.announce.concat(t.tr)),t.urlList=[],("string"==typeof t.as||Array.isArray(t.as))&&(t.urlList=t.urlList.concat(t.as)),("string"==typeof t.ws||Array.isArray(t.ws))&&(t.urlList=t.urlList.concat(t.ws)),t.peerAddresses=[],("string"==typeof t["x.pe"]||Array.isArray(t["x.pe"]))&&(t.peerAddresses=t.peerAddresses.concat(t["x.pe"])),t.announce=Array.from(new Set(t.announce)),t.urlList=Array.from(new Set(t.urlList)),t.peerAddresses=Array.from(new Set(t.peerAddresses)),t}}).call(this)}).call(this,e("buffer").Buffer)},{"bep53-range":25,buffer:116,"thirty-two":482}],264:[function(e,t,n){"use strict";var i=e("inherits"),r=e("hash-base"),s=e("safe-buffer").Buffer,o=new Array(16);function a(){r.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878}function c(e,t){return e<>>32-t}function u(e,t,n,i,r,s,o){return c(e+(t&n|~t&i)+r+s|0,o)+t|0}function l(e,t,n,i,r,s,o){return c(e+(t&i|n&~i)+r+s|0,o)+t|0}function d(e,t,n,i,r,s,o){return c(e+(t^n^i)+r+s|0,o)+t|0}function f(e,t,n,i,r,s,o){return c(e+(n^(t|~i))+r+s|0,o)+t|0}i(a,r),a.prototype._update=function(){for(var e=o,t=0;t<16;++t)e[t]=this._block.readInt32LE(4*t);var n=this._a,i=this._b,r=this._c,s=this._d;n=u(n,i,r,s,e[0],3614090360,7),s=u(s,n,i,r,e[1],3905402710,12),r=u(r,s,n,i,e[2],606105819,17),i=u(i,r,s,n,e[3],3250441966,22),n=u(n,i,r,s,e[4],4118548399,7),s=u(s,n,i,r,e[5],1200080426,12),r=u(r,s,n,i,e[6],2821735955,17),i=u(i,r,s,n,e[7],4249261313,22),n=u(n,i,r,s,e[8],1770035416,7),s=u(s,n,i,r,e[9],2336552879,12),r=u(r,s,n,i,e[10],4294925233,17),i=u(i,r,s,n,e[11],2304563134,22),n=u(n,i,r,s,e[12],1804603682,7),s=u(s,n,i,r,e[13],4254626195,12),r=u(r,s,n,i,e[14],2792965006,17),n=l(n,i=u(i,r,s,n,e[15],1236535329,22),r,s,e[1],4129170786,5),s=l(s,n,i,r,e[6],3225465664,9),r=l(r,s,n,i,e[11],643717713,14),i=l(i,r,s,n,e[0],3921069994,20),n=l(n,i,r,s,e[5],3593408605,5),s=l(s,n,i,r,e[10],38016083,9),r=l(r,s,n,i,e[15],3634488961,14),i=l(i,r,s,n,e[4],3889429448,20),n=l(n,i,r,s,e[9],568446438,5),s=l(s,n,i,r,e[14],3275163606,9),r=l(r,s,n,i,e[3],4107603335,14),i=l(i,r,s,n,e[8],1163531501,20),n=l(n,i,r,s,e[13],2850285829,5),s=l(s,n,i,r,e[2],4243563512,9),r=l(r,s,n,i,e[7],1735328473,14),n=d(n,i=l(i,r,s,n,e[12],2368359562,20),r,s,e[5],4294588738,4),s=d(s,n,i,r,e[8],2272392833,11),r=d(r,s,n,i,e[11],1839030562,16),i=d(i,r,s,n,e[14],4259657740,23),n=d(n,i,r,s,e[1],2763975236,4),s=d(s,n,i,r,e[4],1272893353,11),r=d(r,s,n,i,e[7],4139469664,16),i=d(i,r,s,n,e[10],3200236656,23),n=d(n,i,r,s,e[13],681279174,4),s=d(s,n,i,r,e[0],3936430074,11),r=d(r,s,n,i,e[3],3572445317,16),i=d(i,r,s,n,e[6],76029189,23),n=d(n,i,r,s,e[9],3654602809,4),s=d(s,n,i,r,e[12],3873151461,11),r=d(r,s,n,i,e[15],530742520,16),n=f(n,i=d(i,r,s,n,e[2],3299628645,23),r,s,e[0],4096336452,6),s=f(s,n,i,r,e[7],1126891415,10),r=f(r,s,n,i,e[14],2878612391,15),i=f(i,r,s,n,e[5],4237533241,21),n=f(n,i,r,s,e[12],1700485571,6),s=f(s,n,i,r,e[3],2399980690,10),r=f(r,s,n,i,e[10],4293915773,15),i=f(i,r,s,n,e[1],2240044497,21),n=f(n,i,r,s,e[8],1873313359,6),s=f(s,n,i,r,e[15],4264355552,10),r=f(r,s,n,i,e[6],2734768916,15),i=f(i,r,s,n,e[13],1309151649,21),n=f(n,i,r,s,e[4],4149444226,6),s=f(s,n,i,r,e[11],3174756917,10),r=f(r,s,n,i,e[2],718787259,15),i=f(i,r,s,n,e[9],3951481745,21),this._a=this._a+n|0,this._b=this._b+i|0,this._c=this._c+r|0,this._d=this._d+s|0},a.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var e=s.allocUnsafe(16);return e.writeInt32LE(this._a,0),e.writeInt32LE(this._b,4),e.writeInt32LE(this._c,8),e.writeInt32LE(this._d,12),e},t.exports=a},{"hash-base":217,inherits:249,"safe-buffer":386}],265:[function(e,t,n){ +t.exports=s,t.exports.decode=s,t.exports.encode=function(e){e=Object.assign({},e);let t=new Set;e.xt&&"string"==typeof e.xt&&t.add(e.xt);e.xt&&Array.isArray(e.xt)&&(t=new Set(e.xt));e.infoHashBuffer&&t.add(`urn:btih:${e.infoHashBuffer.toString("hex")}`);e.infoHash&&t.add(`urn:btih:${e.infoHash}`);e.infoHashV2Buffer&&t.add(e.xt=`urn:btmh:1220${e.infoHashV2Buffer.toString("hex")}`);e.infoHashV2&&t.add(`urn:btmh:1220${e.infoHashV2}`);const i=Array.from(t);1===i.length&&(e.xt=i[0]);i.length>1&&(e.xt=i);e.publicKeyBuffer&&(e.xs=`urn:btpk:${e.publicKeyBuffer.toString("hex")}`);e.publicKey&&(e.xs=`urn:btpk:${e.publicKey}`);e.name&&(e.dn=e.name);e.keywords&&(e.kt=e.keywords);e.announce&&(e.tr=e.announce);e.urlList&&(e.ws=e.urlList,delete e.as);e.peerAddresses&&(e["x.pe"]=e.peerAddresses);let n="magnet:?";return Object.keys(e).filter((e=>2===e.length||"x.pe"===e)).forEach(((t,i)=>{const s=Array.isArray(e[t])?e[t]:[e[t]];s.forEach(((e,r)=>{(i>0||r>0)&&("kt"!==t&&"so"!==t||0===r)&&(n+="&"),"dn"===t&&(e=encodeURIComponent(e).replace(/%20/g,"+")),"tr"!==t&&"as"!==t&&"ws"!==t||(e=encodeURIComponent(e)),"xs"!==t||e.startsWith("urn:btpk:")||(e=encodeURIComponent(e)),"kt"===t&&(e=encodeURIComponent(e)),"so"!==t&&(n+="kt"===t&&r>0?`+${e}`:`${t}=${e}`)})),"so"===t&&(n+=`${t}=${r.compose(s)}`)})),n};const n=e("thirty-two"),r=e("bep53-range");function s(e){const t={},s=e.split("magnet:?")[1];let a;if((s&&s.length>=0?s.split("&"):[]).forEach((e=>{const i=e.split("=");if(2!==i.length)return;const n=i[0];let s=i[1];"dn"===n&&(s=decodeURIComponent(s).replace(/\+/g," ")),"tr"!==n&&"xs"!==n&&"as"!==n&&"ws"!==n||(s=decodeURIComponent(s)),"kt"===n&&(s=decodeURIComponent(s).split("+")),"ix"===n&&(s=Number(s)),"so"===n&&(s=r.parse(decodeURIComponent(s).split(","))),t[n]?(Array.isArray(t[n])||(t[n]=[t[n]]),t[n].push(s)):t[n]=s})),t.xt){(Array.isArray(t.xt)?t.xt:[t.xt]).forEach((e=>{if(a=e.match(/^urn:btih:(.{40})/))t.infoHash=a[1].toLowerCase();else if(a=e.match(/^urn:btih:(.{32})/)){const e=n.decode(a[1]);t.infoHash=i.from(e,"binary").toString("hex")}else(a=e.match(/^urn:btmh:1220(.{64})/))&&(t.infoHashV2=a[1].toLowerCase())}))}if(t.xs){(Array.isArray(t.xs)?t.xs:[t.xs]).forEach((e=>{(a=e.match(/^urn:btpk:(.{64})/))&&(t.publicKey=a[1].toLowerCase())}))}return t.infoHash&&(t.infoHashBuffer=i.from(t.infoHash,"hex")),t.infoHashV2&&(t.infoHashV2Buffer=i.from(t.infoHashV2,"hex")),t.publicKey&&(t.publicKeyBuffer=i.from(t.publicKey,"hex")),t.dn&&(t.name=t.dn),t.kt&&(t.keywords=t.kt),t.announce=[],("string"==typeof t.tr||Array.isArray(t.tr))&&(t.announce=t.announce.concat(t.tr)),t.urlList=[],("string"==typeof t.as||Array.isArray(t.as))&&(t.urlList=t.urlList.concat(t.as)),("string"==typeof t.ws||Array.isArray(t.ws))&&(t.urlList=t.urlList.concat(t.ws)),t.peerAddresses=[],("string"==typeof t["x.pe"]||Array.isArray(t["x.pe"]))&&(t.peerAddresses=t.peerAddresses.concat(t["x.pe"])),t.announce=Array.from(new Set(t.announce)),t.urlList=Array.from(new Set(t.urlList)),t.peerAddresses=Array.from(new Set(t.peerAddresses)),t}}).call(this)}).call(this,e("buffer").Buffer)},{"bep53-range":25,buffer:110,"thirty-two":473}],258:[function(e,t,i){"use strict";var n=e("inherits"),r=e("hash-base"),s=e("safe-buffer").Buffer,a=new Array(16);function o(){r.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878}function c(e,t){return e<>>32-t}function l(e,t,i,n,r,s,a){return c(e+(t&i|~t&n)+r+s|0,a)+t|0}function u(e,t,i,n,r,s,a){return c(e+(t&n|i&~n)+r+s|0,a)+t|0}function p(e,t,i,n,r,s,a){return c(e+(t^i^n)+r+s|0,a)+t|0}function d(e,t,i,n,r,s,a){return c(e+(i^(t|~n))+r+s|0,a)+t|0}n(o,r),o.prototype._update=function(){for(var e=a,t=0;t<16;++t)e[t]=this._block.readInt32LE(4*t);var i=this._a,n=this._b,r=this._c,s=this._d;i=l(i,n,r,s,e[0],3614090360,7),s=l(s,i,n,r,e[1],3905402710,12),r=l(r,s,i,n,e[2],606105819,17),n=l(n,r,s,i,e[3],3250441966,22),i=l(i,n,r,s,e[4],4118548399,7),s=l(s,i,n,r,e[5],1200080426,12),r=l(r,s,i,n,e[6],2821735955,17),n=l(n,r,s,i,e[7],4249261313,22),i=l(i,n,r,s,e[8],1770035416,7),s=l(s,i,n,r,e[9],2336552879,12),r=l(r,s,i,n,e[10],4294925233,17),n=l(n,r,s,i,e[11],2304563134,22),i=l(i,n,r,s,e[12],1804603682,7),s=l(s,i,n,r,e[13],4254626195,12),r=l(r,s,i,n,e[14],2792965006,17),i=u(i,n=l(n,r,s,i,e[15],1236535329,22),r,s,e[1],4129170786,5),s=u(s,i,n,r,e[6],3225465664,9),r=u(r,s,i,n,e[11],643717713,14),n=u(n,r,s,i,e[0],3921069994,20),i=u(i,n,r,s,e[5],3593408605,5),s=u(s,i,n,r,e[10],38016083,9),r=u(r,s,i,n,e[15],3634488961,14),n=u(n,r,s,i,e[4],3889429448,20),i=u(i,n,r,s,e[9],568446438,5),s=u(s,i,n,r,e[14],3275163606,9),r=u(r,s,i,n,e[3],4107603335,14),n=u(n,r,s,i,e[8],1163531501,20),i=u(i,n,r,s,e[13],2850285829,5),s=u(s,i,n,r,e[2],4243563512,9),r=u(r,s,i,n,e[7],1735328473,14),i=p(i,n=u(n,r,s,i,e[12],2368359562,20),r,s,e[5],4294588738,4),s=p(s,i,n,r,e[8],2272392833,11),r=p(r,s,i,n,e[11],1839030562,16),n=p(n,r,s,i,e[14],4259657740,23),i=p(i,n,r,s,e[1],2763975236,4),s=p(s,i,n,r,e[4],1272893353,11),r=p(r,s,i,n,e[7],4139469664,16),n=p(n,r,s,i,e[10],3200236656,23),i=p(i,n,r,s,e[13],681279174,4),s=p(s,i,n,r,e[0],3936430074,11),r=p(r,s,i,n,e[3],3572445317,16),n=p(n,r,s,i,e[6],76029189,23),i=p(i,n,r,s,e[9],3654602809,4),s=p(s,i,n,r,e[12],3873151461,11),r=p(r,s,i,n,e[15],530742520,16),i=d(i,n=p(n,r,s,i,e[2],3299628645,23),r,s,e[0],4096336452,6),s=d(s,i,n,r,e[7],1126891415,10),r=d(r,s,i,n,e[14],2878612391,15),n=d(n,r,s,i,e[5],4237533241,21),i=d(i,n,r,s,e[12],1700485571,6),s=d(s,i,n,r,e[3],2399980690,10),r=d(r,s,i,n,e[10],4293915773,15),n=d(n,r,s,i,e[1],2240044497,21),i=d(i,n,r,s,e[8],1873313359,6),s=d(s,i,n,r,e[15],4264355552,10),r=d(r,s,i,n,e[6],2734768916,15),n=d(n,r,s,i,e[13],1309151649,21),i=d(i,n,r,s,e[4],4149444226,6),s=d(s,i,n,r,e[11],3174756917,10),r=d(r,s,i,n,e[2],718787259,15),n=d(n,r,s,i,e[9],3951481745,21),this._a=this._a+i|0,this._b=this._b+n|0,this._c=this._c+r|0,this._d=this._d+s|0},o.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var e=s.allocUnsafe(16);return e.writeInt32LE(this._a,0),e.writeInt32LE(this._b,4),e.writeInt32LE(this._c,8),e.writeInt32LE(this._d,12),e},t.exports=o},{"hash-base":214,inherits:246,"safe-buffer":383}],259:[function(e,t,i){ /*! mediasource. MIT License. Feross Aboukhadijeh */ -t.exports=a;var i=e("inherits"),r=e("readable-stream"),s=e("to-arraybuffer"),o="undefined"!=typeof window&&window.MediaSource;function a(e,t){var n=this;if(!(n instanceof a))return new a(e,t);if(!o)throw new Error("web browser lacks MediaSource support");t||(t={}),n._debug=t.debug,n._bufferDuration=t.bufferDuration||60,n._elem=e,n._mediaSource=new o,n._streams=[],n.detailedError=null,n._errorHandler=function(){n._elem.removeEventListener("error",n._errorHandler),n._streams.slice().forEach((function(e){e.destroy(n._elem.error)}))},n._elem.addEventListener("error",n._errorHandler),n._elem.src=window.URL.createObjectURL(n._mediaSource)}function c(e,t){var n=this;if(r.Writable.call(n),n._wrapper=e,n._elem=e._elem,n._mediaSource=e._mediaSource,n._allStreams=e._streams,n._allStreams.push(n),n._bufferDuration=e._bufferDuration,n._sourceBuffer=null,n._debugBuffers=[],n._openHandler=function(){n._onSourceOpen()},n._flowHandler=function(){n._flow()},n._errorHandler=function(e){n.destroyed||n.emit("error",e)},"string"==typeof t)n._type=t,"open"===n._mediaSource.readyState?n._createSourceBuffer():n._mediaSource.addEventListener("sourceopen",n._openHandler);else if(null===t._sourceBuffer)t.destroy(),n._type=t._type,n._mediaSource.addEventListener("sourceopen",n._openHandler);else{if(!t._sourceBuffer)throw new Error("The argument to MediaElementWrapper.createWriteStream must be a string or a previous stream returned from that function");t.destroy(),n._type=t._type,n._sourceBuffer=t._sourceBuffer,n._debugBuffers=t._debugBuffers,n._sourceBuffer.addEventListener("updateend",n._flowHandler),n._sourceBuffer.addEventListener("error",n._errorHandler)}n._elem.addEventListener("timeupdate",n._flowHandler),n.on("error",(function(e){n._wrapper.error(e)})),n.on("finish",(function(){if(!n.destroyed&&(n._finished=!0,n._allStreams.every((function(e){return e._finished})))){n._wrapper._dumpDebugData();try{n._mediaSource.endOfStream()}catch(e){}}}))}a.prototype.createWriteStream=function(e){return new c(this,e)},a.prototype.error=function(e){var t=this;t.detailedError||(t.detailedError=e),t._dumpDebugData();try{t._mediaSource.endOfStream("decode")}catch(e){}try{window.URL.revokeObjectURL(t._elem.src)}catch(e){}},a.prototype._dumpDebugData=function(){var e=this;e._debug&&(e._debug=!1,e._streams.forEach((function(e,t){var n,i,r;n=e._debugBuffers,i="mediasource-stream-"+t,(r=document.createElement("a")).href=window.URL.createObjectURL(new window.Blob(n)),r.download=i,r.click()})))},i(c,r.Writable),c.prototype._onSourceOpen=function(){var e=this;e.destroyed||(e._mediaSource.removeEventListener("sourceopen",e._openHandler),e._createSourceBuffer())},c.prototype.destroy=function(e){var t=this;t.destroyed||(t.destroyed=!0,t._allStreams.splice(t._allStreams.indexOf(t),1),t._mediaSource.removeEventListener("sourceopen",t._openHandler),t._elem.removeEventListener("timeupdate",t._flowHandler),t._sourceBuffer&&(t._sourceBuffer.removeEventListener("updateend",t._flowHandler),t._sourceBuffer.removeEventListener("error",t._errorHandler),"open"===t._mediaSource.readyState&&t._sourceBuffer.abort()),e&&t.emit("error",e),t.emit("close"))},c.prototype._createSourceBuffer=function(){var e=this;if(!e.destroyed)if(o.isTypeSupported(e._type)){if(e._sourceBuffer=e._mediaSource.addSourceBuffer(e._type),e._sourceBuffer.addEventListener("updateend",e._flowHandler),e._sourceBuffer.addEventListener("error",e._errorHandler),e._cb){var t=e._cb;e._cb=null,t()}}else e.destroy(new Error("The provided type is not supported"))},c.prototype._write=function(e,t,n){var i=this;if(!i.destroyed)if(i._sourceBuffer){if(i._sourceBuffer.updating)return n(new Error("Cannot append buffer while source buffer updating"));var r=s(e);i._wrapper._debug&&i._debugBuffers.push(r);try{i._sourceBuffer.appendBuffer(r)}catch(e){return void i.destroy(e)}i._cb=n}else i._cb=function(r){if(r)return n(r);i._write(e,t,n)}},c.prototype._flow=function(){var e=this;if(!e.destroyed&&e._sourceBuffer&&!e._sourceBuffer.updating&&!("open"===e._mediaSource.readyState&&e._getBufferDuration()>e._bufferDuration)&&e._cb){var t=e._cb;e._cb=null,t()}};c.prototype._getBufferDuration=function(){for(var e=this._sourceBuffer.buffered,t=this._elem.currentTime,n=-1,i=0;it)break;(n>=0||t<=s)&&(n=s)}var o=n-t;return o<0&&(o=0),o}},{inherits:249,"readable-stream":280,"to-arraybuffer":485}],266:[function(e,t,n){arguments[4][32][0].apply(n,arguments)},{dup:32}],267:[function(e,t,n){arguments[4][33][0].apply(n,arguments)},{"./_stream_readable":269,"./_stream_writable":271,_process:342,dup:33,inherits:249}],268:[function(e,t,n){arguments[4][34][0].apply(n,arguments)},{"./_stream_transform":270,dup:34,inherits:249}],269:[function(e,t,n){arguments[4][35][0].apply(n,arguments)},{"../errors":266,"./_stream_duplex":267,"./internal/streams/async_iterator":272,"./internal/streams/buffer_list":273,"./internal/streams/destroy":274,"./internal/streams/from":276,"./internal/streams/state":278,"./internal/streams/stream":279,_process:342,buffer:116,dup:35,events:196,inherits:249,"string_decoder/":481,util:73}],270:[function(e,t,n){arguments[4][36][0].apply(n,arguments)},{"../errors":266,"./_stream_duplex":267,dup:36,inherits:249}],271:[function(e,t,n){arguments[4][37][0].apply(n,arguments)},{"../errors":266,"./_stream_duplex":267,"./internal/streams/destroy":274,"./internal/streams/state":278,"./internal/streams/stream":279,_process:342,buffer:116,dup:37,inherits:249,"util-deprecate":500}],272:[function(e,t,n){arguments[4][38][0].apply(n,arguments)},{"./end-of-stream":275,_process:342,dup:38}],273:[function(e,t,n){arguments[4][39][0].apply(n,arguments)},{buffer:116,dup:39,util:73}],274:[function(e,t,n){arguments[4][40][0].apply(n,arguments)},{_process:342,dup:40}],275:[function(e,t,n){arguments[4][41][0].apply(n,arguments)},{"../../../errors":266,dup:41}],276:[function(e,t,n){arguments[4][42][0].apply(n,arguments)},{dup:42}],277:[function(e,t,n){arguments[4][43][0].apply(n,arguments)},{"../../../errors":266,"./end-of-stream":275,dup:43}],278:[function(e,t,n){arguments[4][44][0].apply(n,arguments)},{"../../../errors":266,dup:44}],279:[function(e,t,n){arguments[4][45][0].apply(n,arguments)},{dup:45,events:196}],280:[function(e,t,n){arguments[4][46][0].apply(n,arguments)},{"./lib/_stream_duplex.js":267,"./lib/_stream_passthrough.js":268,"./lib/_stream_readable.js":269,"./lib/_stream_transform.js":270,"./lib/_stream_writable.js":271,"./lib/internal/streams/end-of-stream.js":275,"./lib/internal/streams/pipeline.js":277,dup:46}],281:[function(e,t,n){t.exports=r;const i=e("queue-microtask");function r(e,t){if(!(this instanceof r))return new r(e,t);if(t||(t={}),this.chunkLength=Number(e),!this.chunkLength)throw new Error("First argument must be a chunk length");this.chunks=[],this.closed=!1,this.length=Number(t.length)||1/0,this.length!==1/0&&(this.lastChunkLength=this.length%this.chunkLength||this.chunkLength,this.lastChunkIndex=Math.ceil(this.length/this.chunkLength)-1)}r.prototype.put=function(e,t,n=(()=>{})){if(this.closed)return i((()=>n(new Error("Storage is closed"))));const r=e===this.lastChunkIndex;return r&&t.length!==this.lastChunkLength?i((()=>n(new Error("Last chunk length must be "+this.lastChunkLength)))):r||t.length===this.chunkLength?(this.chunks[e]=t,void i((()=>n(null)))):i((()=>n(new Error("Chunk length must be "+this.chunkLength))))},r.prototype.get=function(e,t,n=(()=>{})){if("function"==typeof t)return this.get(e,null,t);if(this.closed)return i((()=>n(new Error("Storage is closed"))));let r=this.chunks[e];if(!r){const e=new Error("Chunk not found");return e.notFound=!0,i((()=>n(e)))}t||(t={});const s=t.offset||0,o=t.length||r.length-s;0===s&&o===r.length||(r=r.slice(s,o+s)),i((()=>n(null,r)))},r.prototype.close=r.prototype.destroy=function(e=(()=>{})){if(this.closed)return i((()=>e(new Error("Storage is closed"))));this.closed=!0,this.chunks=null,i((()=>e(null)))}},{"queue-microtask":355}],282:[function(e,t,n){var i=e("bn.js"),r=e("brorand");function s(e){this.rand=e||new r.Rand}t.exports=s,s.create=function(e){return new s(e)},s.prototype._randbelow=function(e){var t=e.bitLength(),n=Math.ceil(t/8);do{var r=new i(this.rand.generate(n))}while(r.cmp(e)>=0);return r},s.prototype._randrange=function(e,t){var n=t.sub(e);return e.add(this._randbelow(n))},s.prototype.test=function(e,t,n){var r=e.bitLength(),s=i.mont(e),o=new i(1).toRed(s);t||(t=Math.max(1,r/48|0));for(var a=e.subn(1),c=0;!a.testn(c);c++);for(var u=e.shrn(c),l=a.toRed(s);t>0;t--){var d=this._randrange(new i(2),a);n&&n(d);var f=d.toRed(s).redPow(u);if(0!==f.cmp(o)&&0!==f.cmp(l)){for(var p=1;p0;t--){var l=this._randrange(new i(2),o),d=e.gcd(l);if(0!==d.cmpn(1))return d;var f=l.toRed(r).redPow(c);if(0!==f.cmp(s)&&0!==f.cmp(u)){for(var p=1;pe._bufferDuration)&&e._cb){var t=e._cb;e._cb=null,t()}};c.prototype._getBufferDuration=function(){for(var e=this._sourceBuffer.buffered,t=this._elem.currentTime,i=-1,n=0;nt)break;(i>=0||t<=s)&&(i=s)}var a=i-t;return a<0&&(a=0),a}},{inherits:246,"readable-stream":274,"to-arraybuffer":476}],260:[function(e,t,i){arguments[4][29][0].apply(i,arguments)},{dup:29}],261:[function(e,t,i){arguments[4][30][0].apply(i,arguments)},{"./_stream_readable":263,"./_stream_writable":265,_process:341,dup:30,inherits:246}],262:[function(e,t,i){arguments[4][31][0].apply(i,arguments)},{"./_stream_transform":264,dup:31,inherits:246}],263:[function(e,t,i){arguments[4][32][0].apply(i,arguments)},{"../errors":260,"./_stream_duplex":261,"./internal/streams/async_iterator":266,"./internal/streams/buffer_list":267,"./internal/streams/destroy":268,"./internal/streams/from":270,"./internal/streams/state":272,"./internal/streams/stream":273,_process:341,buffer:110,dup:32,events:193,inherits:246,"string_decoder/":472,util:67}],264:[function(e,t,i){arguments[4][33][0].apply(i,arguments)},{"../errors":260,"./_stream_duplex":261,dup:33,inherits:246}],265:[function(e,t,i){arguments[4][34][0].apply(i,arguments)},{"../errors":260,"./_stream_duplex":261,"./internal/streams/destroy":268,"./internal/streams/state":272,"./internal/streams/stream":273,_process:341,buffer:110,dup:34,inherits:246,"util-deprecate":485}],266:[function(e,t,i){arguments[4][35][0].apply(i,arguments)},{"./end-of-stream":269,_process:341,dup:35}],267:[function(e,t,i){arguments[4][36][0].apply(i,arguments)},{buffer:110,dup:36,util:67}],268:[function(e,t,i){arguments[4][37][0].apply(i,arguments)},{_process:341,dup:37}],269:[function(e,t,i){arguments[4][38][0].apply(i,arguments)},{"../../../errors":260,dup:38}],270:[function(e,t,i){arguments[4][39][0].apply(i,arguments)},{dup:39}],271:[function(e,t,i){arguments[4][40][0].apply(i,arguments)},{"../../../errors":260,"./end-of-stream":269,dup:40}],272:[function(e,t,i){arguments[4][41][0].apply(i,arguments)},{"../../../errors":260,dup:41}],273:[function(e,t,i){arguments[4][42][0].apply(i,arguments)},{dup:42,events:193}],274:[function(e,t,i){arguments[4][43][0].apply(i,arguments)},{"./lib/_stream_duplex.js":261,"./lib/_stream_passthrough.js":262,"./lib/_stream_readable.js":263,"./lib/_stream_transform.js":264,"./lib/_stream_writable.js":265,"./lib/internal/streams/end-of-stream.js":269,"./lib/internal/streams/pipeline.js":271,dup:43}],275:[function(e,t,i){t.exports=r;const n=e("queue-microtask");function r(e,t){if(!(this instanceof r))return new r(e,t);if(t||(t={}),this.chunkLength=Number(e),!this.chunkLength)throw new Error("First argument must be a chunk length");this.chunks=[],this.closed=!1,this.length=Number(t.length)||1/0,this.length!==1/0&&(this.lastChunkLength=this.length%this.chunkLength||this.chunkLength,this.lastChunkIndex=Math.ceil(this.length/this.chunkLength)-1)}r.prototype.put=function(e,t,i=(()=>{})){if(this.closed)return n((()=>i(new Error("Storage is closed"))));const r=e===this.lastChunkIndex;return r&&t.length!==this.lastChunkLength?n((()=>i(new Error("Last chunk length must be "+this.lastChunkLength)))):r||t.length===this.chunkLength?(this.chunks[e]=t,void n((()=>i(null)))):n((()=>i(new Error("Chunk length must be "+this.chunkLength))))},r.prototype.get=function(e,t,i=(()=>{})){if("function"==typeof t)return this.get(e,null,t);if(this.closed)return n((()=>i(new Error("Storage is closed"))));let r=this.chunks[e];if(!r){const e=new Error("Chunk not found");return e.notFound=!0,n((()=>i(e)))}t||(t={});const s=t.offset||0,a=t.length||r.length-s;0===s&&a===r.length||(r=r.slice(s,a+s)),n((()=>i(null,r)))},r.prototype.close=r.prototype.destroy=function(e=(()=>{})){if(this.closed)return n((()=>e(new Error("Storage is closed"))));this.closed=!0,this.chunks=null,n((()=>e(null)))}},{"queue-microtask":354}],276:[function(e,t,i){var n=e("bn.js"),r=e("brorand");function s(e){this.rand=e||new r.Rand}t.exports=s,s.create=function(e){return new s(e)},s.prototype._randbelow=function(e){var t=e.bitLength(),i=Math.ceil(t/8);do{var r=new n(this.rand.generate(i))}while(r.cmp(e)>=0);return r},s.prototype._randrange=function(e,t){var i=t.sub(e);return e.add(this._randbelow(i))},s.prototype.test=function(e,t,i){var r=e.bitLength(),s=n.mont(e),a=new n(1).toRed(s);t||(t=Math.max(1,r/48|0));for(var o=e.subn(1),c=0;!o.testn(c);c++);for(var l=e.shrn(c),u=o.toRed(s);t>0;t--){var p=this._randrange(new n(2),o);i&&i(p);var d=p.toRed(s).redPow(l);if(0!==d.cmp(a)&&0!==d.cmp(u)){for(var f=1;f0;t--){var u=this._randrange(new n(2),a),p=e.gcd(u);if(0!==p.cmpn(1))return p;var d=u.toRed(r).redPow(c);if(0!==d.cmp(s)&&0!==d.cmp(l)){for(var f=1;fl||u===l&&"application/"===r[c].substr(0,12)))continue}r[c]=e}}}))},{"mime-db":285,path:334}],287:[function(e,t,n){function i(e,t){if(!e)throw new Error(t||"Assertion failed")}t.exports=i,i.equal=function(e,t,n){if(e!=t)throw new Error(n||"Assertion failed: "+e+" != "+t)}},{}],288:[function(e,t,n){"use strict";var i=n;function r(e){return 1===e.length?"0"+e:e}function s(e){for(var t="",n=0;n>8,o=255&r;s?n.push(s,o):n.push(o)}return n},i.zero2=r,i.toHex=s,i.encode=function(e,t){return"hex"===t?s(e):e}},{}],289:[function(e,t,n){(function(t){(function(){var i=e("./index"),r=e("./descriptor"),s=e("uint64be"),o=20828448e5;n.fullBoxes={};function a(e,t,n){for(var i=t;i=8;){var c=i.decode(e,a,r);o.children.push(c),o[c.type]=c,a+=c.length}return o},n.VisualSampleEntry.encodingLength=function(e){var t=78;return(e.children||[]).forEach((function(e){t+=i.encodingLength(e)})),t},n.avcC={},n.avcC.encode=function(e,i,r){i=i?i.slice(r):t.alloc(e.buffer.length),e.buffer.copy(i),n.avcC.encode.bytes=e.buffer.length},n.avcC.decode=function(e,n,i){return{mimeCodec:(e=e.slice(n,i)).toString("hex",1,4),buffer:t.from(e)}},n.avcC.encodingLength=function(e){return e.buffer.length},n.mp4a=n.AudioSampleEntry={},n.AudioSampleEntry.encode=function(e,r,s){a(r=r?r.slice(s):t.alloc(n.AudioSampleEntry.encodingLength(e)),0,6),r.writeUInt16BE(e.dataReferenceIndex||0,6),a(r,8,16),r.writeUInt16BE(e.channelCount||2,16),r.writeUInt16BE(e.sampleSize||16,18),a(r,20,24),r.writeUInt32BE(e.sampleRate||0,24);var o=28;(e.children||[]).forEach((function(e){i.encode(e,r,o),o+=i.encode.bytes})),n.AudioSampleEntry.encode.bytes=o},n.AudioSampleEntry.decode=function(e,t,n){for(var r=n-t,s={dataReferenceIndex:(e=e.slice(t,n)).readUInt16BE(6),channelCount:e.readUInt16BE(16),sampleSize:e.readUInt16BE(18),sampleRate:e.readUInt32BE(24),children:[]},o=28;r-o>=8;){var a=i.decode(e,o,r);s.children.push(a),s[a.type]=a,o+=a.length}return s},n.AudioSampleEntry.encodingLength=function(e){var t=28;return(e.children||[]).forEach((function(e){t+=i.encodingLength(e)})),t},n.esds={},n.esds.encode=function(e,i,r){i=i?i.slice(r):t.alloc(e.buffer.length),e.buffer.copy(i,0),n.esds.encode.bytes=e.buffer.length},n.esds.decode=function(e,n,i){e=e.slice(n,i);var s=r.Descriptor.decode(e,0,e.length),o=("ESDescriptor"===s.tagName?s:{}).DecoderConfigDescriptor||{},a=o.oti||0,c=o.DecoderSpecificInfo,u=c?(248&c.buffer.readUInt8(0))>>3:0,l=null;return a&&(l=a.toString(16),u&&(l+="."+u)),{mimeCodec:l,buffer:t.from(e.slice(0))}},n.esds.encodingLength=function(e){return e.buffer.length},n.stsz={},n.stsz.encode=function(e,i,r){var s=e.entries||[];(i=i?i.slice(r):t.alloc(n.stsz.encodingLength(e))).writeUInt32BE(0,0),i.writeUInt32BE(s.length,4);for(var o=0;os&&(u=1),t.writeUInt32BE(u,n),t.write(e.type,n+4,4,"ascii");var l=n+8;if(1===u&&(i.encode(e.length,t,l),l+=8),r.fullBoxes[c]&&(t.writeUInt32BE(e.flags||0,l),t.writeUInt8(e.version||0,l),l+=4),a[c])a[c].forEach((function(n){if(5===n.length){var i=e[n]||[];n=n.substr(0,4),i.forEach((function(e){o._encode(e,t,l),l+=o.encode.bytes}))}else e[n]&&(o._encode(e[n],t,l),l+=o.encode.bytes)})),e.otherBoxes&&e.otherBoxes.forEach((function(e){o._encode(e,t,l),l+=o.encode.bytes}));else if(r[c]){var d=r[c].encode;d(e,t,l),l+=d.bytes}else{if(!e.buffer)throw new Error("Either `type` must be set to a known type (not'"+c+"') or `buffer` must be set");e.buffer.copy(t,l),l+=e.buffer.length}return o.encode.bytes=l-n,t},o.readHeaders=function(e,t,n){if(t=t||0,(n=n||e.length)-t<8)return 8;var s,o,a=e.readUInt32BE(t),c=e.toString("ascii",t+4,t+8),u=t+8;if(1===a){if(n-t<16)return 16;a=i.decode(e,u),u+=8}return r.fullBoxes[c]&&(s=e.readUInt8(u),o=16777215&e.readUInt32BE(u),u+=4),{length:a,headersLen:u-t,contentLen:a-(u-t),type:c,version:s,flags:o}},o.decode=function(e,t,n){t=t||0,n=n||e.length;var i=o.readHeaders(e,t,n);if(!i||i.length>n-t)throw new Error("Data too short");return o.decodeWithoutHeaders(i,e,t+i.headersLen,t+i.length)},o.decodeWithoutHeaders=function(e,n,i,s){i=i||0,s=s||n.length;var c=e.type,u={};if(a[c]){u.otherBoxes=[];for(var l=a[c],d=i;s-d>=8;){var f=o.decode(n,d,s);if(d+=f.length,l.indexOf(f.type)>=0)u[f.type]=f;else if(l.indexOf(f.type+"s")>=0){var p=f.type+"s";(u[p]=u[p]||[]).push(f)}else u.otherBoxes.push(f)}}else if(r[c]){u=(0,r[c].decode)(n,i,s)}else u.buffer=t.from(n.slice(i,s));return u.length=e.length,u.contentLen=e.contentLen,u.type=e.type,u.version=e.version,u.flags=e.flags,u},o.encodingLength=function(e){var t=e.type,n=8;if(r.fullBoxes[t]&&(n+=4),a[t])a[t].forEach((function(t){if(5===t.length){var i=e[t]||[];t=t.substr(0,4),i.forEach((function(e){e.type=t,n+=o.encodingLength(e)}))}else if(e[t]){var r=e[t];r.type=t,n+=o.encodingLength(r)}})),e.otherBoxes&&e.otherBoxes.forEach((function(e){n+=o.encodingLength(e)}));else if(r[t])n+=r[t].encodingLength(e);else{if(!e.buffer)throw new Error("Either `type` must be set to a known type (not'"+t+"') or `buffer` must be set");n+=e.buffer.length}return n>s&&(n+=8),e.length=n,n}}).call(this)}).call(this,e("buffer").Buffer)},{"./boxes":289,buffer:116,uint64be:492}],292:[function(e,t,n){(function(n){(function(){var i=e("readable-stream"),r=e("next-event"),s=e("mp4-box-encoding"),o=n.alloc(0);class a extends i.Writable{constructor(e){super(e),this.destroyed=!1,this._pending=0,this._missing=0,this._ignoreEmpty=!1,this._buf=null,this._str=null,this._cb=null,this._ondrain=null,this._writeBuffer=null,this._writeCb=null,this._ondrain=null,this._kick()}destroy(e){this.destroyed||(this.destroyed=!0,e&&this.emit("error",e),this.emit("close"))}_write(e,t,n){if(!this.destroyed){for(var i=!this._str||!this._str._writableState.needDrain;e.length&&!this.destroyed;){if(!this._missing&&!this._ignoreEmpty)return this._writeBuffer=e,void(this._writeCb=n);var r=e.length{this._pending--,this._kick()})),this._cb=t,this._str}_readBox(){const e=(t,i)=>{this._buffer(t,(t=>{i=i?n.concat([i,t]):t;var r=s.readHeaders(i);"number"==typeof r?e(r-i.length,i):(this._pending++,this._headers=r,this.emit("box",r))}))};e(8)}stream(){if(!this._headers)throw new Error("this function can only be called once after 'box' is emitted");var e=this._headers;return this._headers=null,this._stream(e.contentLen,(()=>{this._pending--,this._kick()}))}decode(e){if(!this._headers)throw new Error("this function can only be called once after 'box' is emitted");var t=this._headers;this._headers=null,this._buffer(t.contentLen,(n=>{var i=s.decodeWithoutHeaders(t,n);e(i),this._pending--,this._kick()}))}ignore(){if(!this._headers)throw new Error("this function can only be called once after 'box' is emitted");var e=this._headers;this._headers=null,this._missing=e.contentLen,0===this._missing&&(this._ignoreEmpty=!0),this._cb=()=>{this._pending--,this._kick()}}_kick(){if(!this._pending&&(this._buf||this._str||this._readBox(),this._writeBuffer)){var e=this._writeCb,t=this._writeBuffer;this._writeBuffer=null,this._writeCb=null,this._write(t,null,e)}}}class c extends i.PassThrough{constructor(e){super(),this._parent=e,this.destroyed=!1}destroy(e){this.destroyed||(this.destroyed=!0,this._parent.destroy(e),e&&this.emit("error",e),this.emit("close"))}}t.exports=a}).call(this)}).call(this,e("buffer").Buffer)},{buffer:116,"mp4-box-encoding":291,"next-event":326,"readable-stream":309}],293:[function(e,t,n){(function(n){(function(){var i=e("readable-stream"),r=e("mp4-box-encoding"),s=e("queue-microtask");function o(){}class a extends i.Readable{constructor(e){super(e),this.destroyed=!1,this._finalized=!1,this._reading=!1,this._stream=null,this._drain=null,this._want=!1,this._onreadable=()=>{this._want&&(this._want=!1,this._read())},this._onend=()=>{this._stream=null}}mdat(e,t){this.mediaData(e,t)}mediaData(e,t){var n=new c(this);return this.box({type:"mdat",contentLength:e,encodeBufferLen:8,stream:n},t),n}box(e,t){if(t||(t=o),this.destroyed)return t(new Error("Encoder is destroyed"));var i;if(e.encodeBufferLen&&(i=n.alloc(e.encodeBufferLen)),e.stream)e.buffer=null,i=r.encode(e,i),this.push(i),this._stream=e.stream,this._stream.on("readable",this._onreadable),this._stream.on("end",this._onend),this._stream.on("end",t),this._forward();else{if(i=r.encode(e,i),this.push(i))return s(t);this._drain=t}}destroy(e){if(!this.destroyed){if(this.destroyed=!0,this._stream&&this._stream.destroy&&this._stream.destroy(),this._stream=null,this._drain){var t=this._drain;this._drain=null,t(e)}e&&this.emit("error",e),this.emit("close")}}finalize(){this._finalized=!0,this._stream||this._drain||this.push(null)}_forward(){if(this._stream)for(;!this.destroyed;){var e=this._stream.read();if(!e)return void(this._want=!!this._stream);if(!this.push(e))return}}_read(){if(!this._reading&&!this.destroyed){if(this._reading=!0,this._stream&&this._forward(),this._drain){var e=this._drain;this._drain=null,e()}this._reading=!1,this._finalized&&this.push(null)}}}class c extends i.PassThrough{constructor(e){super(),this._parent=e,this.destroyed=!1}destroy(e){this.destroyed||(this.destroyed=!0,this._parent.destroy(e),e&&this.emit("error",e),this.emit("close"))}}t.exports=a}).call(this)}).call(this,e("buffer").Buffer)},{buffer:116,"mp4-box-encoding":291,"queue-microtask":355,"readable-stream":309}],294:[function(e,t,n){const i=e("./decode"),r=e("./encode");n.decode=e=>new i(e),n.encode=e=>new r(e)},{"./decode":292,"./encode":293}],295:[function(e,t,n){arguments[4][32][0].apply(n,arguments)},{dup:32}],296:[function(e,t,n){arguments[4][33][0].apply(n,arguments)},{"./_stream_readable":298,"./_stream_writable":300,_process:342,dup:33,inherits:249}],297:[function(e,t,n){arguments[4][34][0].apply(n,arguments)},{"./_stream_transform":299,dup:34,inherits:249}],298:[function(e,t,n){arguments[4][35][0].apply(n,arguments)},{"../errors":295,"./_stream_duplex":296,"./internal/streams/async_iterator":301,"./internal/streams/buffer_list":302,"./internal/streams/destroy":303,"./internal/streams/from":305,"./internal/streams/state":307,"./internal/streams/stream":308,_process:342,buffer:116,dup:35,events:196,inherits:249,"string_decoder/":481,util:73}],299:[function(e,t,n){arguments[4][36][0].apply(n,arguments)},{"../errors":295,"./_stream_duplex":296,dup:36,inherits:249}],300:[function(e,t,n){arguments[4][37][0].apply(n,arguments)},{"../errors":295,"./_stream_duplex":296,"./internal/streams/destroy":303,"./internal/streams/state":307,"./internal/streams/stream":308,_process:342,buffer:116,dup:37,inherits:249,"util-deprecate":500}],301:[function(e,t,n){arguments[4][38][0].apply(n,arguments)},{"./end-of-stream":304,_process:342,dup:38}],302:[function(e,t,n){arguments[4][39][0].apply(n,arguments)},{buffer:116,dup:39,util:73}],303:[function(e,t,n){arguments[4][40][0].apply(n,arguments)},{_process:342,dup:40}],304:[function(e,t,n){arguments[4][41][0].apply(n,arguments)},{"../../../errors":295,dup:41}],305:[function(e,t,n){arguments[4][42][0].apply(n,arguments)},{dup:42}],306:[function(e,t,n){arguments[4][43][0].apply(n,arguments)},{"../../../errors":295,"./end-of-stream":304,dup:43}],307:[function(e,t,n){arguments[4][44][0].apply(n,arguments)},{"../../../errors":295,dup:44}],308:[function(e,t,n){arguments[4][45][0].apply(n,arguments)},{dup:45,events:196}],309:[function(e,t,n){arguments[4][46][0].apply(n,arguments)},{"./lib/_stream_duplex.js":296,"./lib/_stream_passthrough.js":297,"./lib/_stream_readable.js":298,"./lib/_stream_transform.js":299,"./lib/_stream_writable.js":300,"./lib/internal/streams/end-of-stream.js":304,"./lib/internal/streams/pipeline.js":306,dup:46}],310:[function(e,t,n){ +"use strict";var n,r,s,a=e("mime-db"),o=e("path").extname,c=/^\s*([^;\s]*)(?:;|\s|$)/,l=/^text\//i;function u(e){if(!e||"string"!=typeof e)return!1;var t=c.exec(e),i=t&&a[t[1].toLowerCase()];return i&&i.charset?i.charset:!(!t||!l.test(t[1]))&&"UTF-8"}i.charset=u,i.charsets={lookup:u},i.contentType=function(e){if(!e||"string"!=typeof e)return!1;var t=-1===e.indexOf("/")?i.lookup(e):e;if(!t)return!1;if(-1===t.indexOf("charset")){var n=i.charset(t);n&&(t+="; charset="+n.toLowerCase())}return t},i.extension=function(e){if(!e||"string"!=typeof e)return!1;var t=c.exec(e),n=t&&i.extensions[t[1].toLowerCase()];if(!n||!n.length)return!1;return n[0]},i.extensions=Object.create(null),i.lookup=function(e){if(!e||"string"!=typeof e)return!1;var t=o("x."+e).toLowerCase().substr(1);if(!t)return!1;return i.types[t]||!1},i.types=Object.create(null),n=i.extensions,r=i.types,s=["nginx","apache",void 0,"iana"],Object.keys(a).forEach((function(e){var t=a[e],i=t.extensions;if(i&&i.length){n[e]=i;for(var o=0;ou||l===u&&"application/"===r[c].substr(0,12)))continue}r[c]=e}}}))},{"mime-db":279,path:333}],281:[function(e,t,i){"use strict";function n(){this._types=Object.create(null),this._extensions=Object.create(null);for(let e=0;e>8,a=255&r;s?i.push(s,a):i.push(a)}return i},n.zero2=r,n.toHex=s,n.encode=function(e,t){return"hex"===t?s(e):e}},{}],287:[function(e,t,i){(function(t){(function(){var n=e("./index"),r=e("./descriptor"),s=e("uint64be"),a=20828448e5;i.fullBoxes={};function o(e,t,i){for(var n=t;n=8;){var c=n.decode(e,o,r);a.children.push(c),a[c.type]=c,o+=c.length}return a},i.VisualSampleEntry.encodingLength=function(e){var t=78;return(e.children||[]).forEach((function(e){t+=n.encodingLength(e)})),t},i.avcC={},i.avcC.encode=function(e,n,r){n=n?n.slice(r):t.alloc(e.buffer.length),e.buffer.copy(n),i.avcC.encode.bytes=e.buffer.length},i.avcC.decode=function(e,i,n){return{mimeCodec:(e=e.slice(i,n)).toString("hex",1,4),buffer:t.from(e)}},i.avcC.encodingLength=function(e){return e.buffer.length},i.mp4a=i.AudioSampleEntry={},i.AudioSampleEntry.encode=function(e,r,s){o(r=r?r.slice(s):t.alloc(i.AudioSampleEntry.encodingLength(e)),0,6),r.writeUInt16BE(e.dataReferenceIndex||0,6),o(r,8,16),r.writeUInt16BE(e.channelCount||2,16),r.writeUInt16BE(e.sampleSize||16,18),o(r,20,24),r.writeUInt32BE(e.sampleRate||0,24);var a=28;(e.children||[]).forEach((function(e){n.encode(e,r,a),a+=n.encode.bytes})),i.AudioSampleEntry.encode.bytes=a},i.AudioSampleEntry.decode=function(e,t,i){for(var r=i-t,s={dataReferenceIndex:(e=e.slice(t,i)).readUInt16BE(6),channelCount:e.readUInt16BE(16),sampleSize:e.readUInt16BE(18),sampleRate:e.readUInt32BE(24),children:[]},a=28;r-a>=8;){var o=n.decode(e,a,r);s.children.push(o),s[o.type]=o,a+=o.length}return s},i.AudioSampleEntry.encodingLength=function(e){var t=28;return(e.children||[]).forEach((function(e){t+=n.encodingLength(e)})),t},i.esds={},i.esds.encode=function(e,n,r){n=n?n.slice(r):t.alloc(e.buffer.length),e.buffer.copy(n,0),i.esds.encode.bytes=e.buffer.length},i.esds.decode=function(e,i,n){e=e.slice(i,n);var s=r.Descriptor.decode(e,0,e.length),a=("ESDescriptor"===s.tagName?s:{}).DecoderConfigDescriptor||{},o=a.oti||0,c=a.DecoderSpecificInfo,l=c?(248&c.buffer.readUInt8(0))>>3:0,u=null;return o&&(u=o.toString(16),l&&(u+="."+l)),{mimeCodec:u,buffer:t.from(e.slice(0))}},i.esds.encodingLength=function(e){return e.buffer.length},i.stsz={},i.stsz.encode=function(e,n,r){var s=e.entries||[];(n=n?n.slice(r):t.alloc(i.stsz.encodingLength(e))).writeUInt32BE(0,0),n.writeUInt32BE(s.length,4);for(var a=0;as&&(l=1),t.writeUInt32BE(l,i),t.write(e.type,i+4,4,"ascii");var u=i+8;if(1===l&&(n.encode(e.length,t,u),u+=8),r.fullBoxes[c]&&(t.writeUInt32BE(e.flags||0,u),t.writeUInt8(e.version||0,u),u+=4),o[c])o[c].forEach((function(i){if(5===i.length){var n=e[i]||[];i=i.substr(0,4),n.forEach((function(e){a._encode(e,t,u),u+=a.encode.bytes}))}else e[i]&&(a._encode(e[i],t,u),u+=a.encode.bytes)})),e.otherBoxes&&e.otherBoxes.forEach((function(e){a._encode(e,t,u),u+=a.encode.bytes}));else if(r[c]){var p=r[c].encode;p(e,t,u),u+=p.bytes}else{if(!e.buffer)throw new Error("Either `type` must be set to a known type (not'"+c+"') or `buffer` must be set");e.buffer.copy(t,u),u+=e.buffer.length}return a.encode.bytes=u-i,t},a.readHeaders=function(e,t,i){if(t=t||0,(i=i||e.length)-t<8)return 8;var s,a,o=e.readUInt32BE(t),c=e.toString("ascii",t+4,t+8),l=t+8;if(1===o){if(i-t<16)return 16;o=n.decode(e,l),l+=8}return r.fullBoxes[c]&&(s=e.readUInt8(l),a=16777215&e.readUInt32BE(l),l+=4),{length:o,headersLen:l-t,contentLen:o-(l-t),type:c,version:s,flags:a}},a.decode=function(e,t,i){t=t||0,i=i||e.length;var n=a.readHeaders(e,t,i);if(!n||n.length>i-t)throw new Error("Data too short");return a.decodeWithoutHeaders(n,e,t+n.headersLen,t+n.length)},a.decodeWithoutHeaders=function(e,i,n,s){n=n||0,s=s||i.length;var c=e.type,l={};if(o[c]){l.otherBoxes=[];for(var u=o[c],p=n;s-p>=8;){var d=a.decode(i,p,s);if(p+=d.length,u.indexOf(d.type)>=0)l[d.type]=d;else if(u.indexOf(d.type+"s")>=0){var f=d.type+"s";(l[f]=l[f]||[]).push(d)}else l.otherBoxes.push(d)}}else if(r[c]){l=(0,r[c].decode)(i,n,s)}else l.buffer=t.from(i.slice(n,s));return l.length=e.length,l.contentLen=e.contentLen,l.type=e.type,l.version=e.version,l.flags=e.flags,l},a.encodingLength=function(e){var t=e.type,i=8;if(r.fullBoxes[t]&&(i+=4),o[t])o[t].forEach((function(t){if(5===t.length){var n=e[t]||[];t=t.substr(0,4),n.forEach((function(e){e.type=t,i+=a.encodingLength(e)}))}else if(e[t]){var r=e[t];r.type=t,i+=a.encodingLength(r)}})),e.otherBoxes&&e.otherBoxes.forEach((function(e){i+=a.encodingLength(e)}));else if(r[t])i+=r[t].encodingLength(e);else{if(!e.buffer)throw new Error("Either `type` must be set to a known type (not'"+t+"') or `buffer` must be set");i+=e.buffer.length}return i>s&&(i+=8),e.length=i,i}}).call(this)}).call(this,e("buffer").Buffer)},{"./boxes":287,buffer:110,uint64be:480}],290:[function(e,t,i){(function(i){(function(){var n=e("readable-stream"),r=e("next-event"),s=e("mp4-box-encoding"),a=i.alloc(0);class o extends n.Writable{constructor(e){super(e),this.destroyed=!1,this._pending=0,this._missing=0,this._ignoreEmpty=!1,this._buf=null,this._str=null,this._cb=null,this._ondrain=null,this._writeBuffer=null,this._writeCb=null,this._ondrain=null,this._kick()}destroy(e){this.destroyed||(this.destroyed=!0,e&&this.emit("error",e),this.emit("close"))}_write(e,t,i){if(!this.destroyed){for(var n=!this._str||!this._str._writableState.needDrain;e.length&&!this.destroyed;){if(!this._missing&&!this._ignoreEmpty)return this._writeBuffer=e,void(this._writeCb=i);var r=e.length{this._pending--,this._kick()})),this._cb=t,this._str}_readBox(){const e=(t,n)=>{this._buffer(t,(t=>{n=n?i.concat([n,t]):t;var r=s.readHeaders(n);"number"==typeof r?e(r-n.length,n):(this._pending++,this._headers=r,this.emit("box",r))}))};e(8)}stream(){if(!this._headers)throw new Error("this function can only be called once after 'box' is emitted");var e=this._headers;return this._headers=null,this._stream(e.contentLen,(()=>{this._pending--,this._kick()}))}decode(e){if(!this._headers)throw new Error("this function can only be called once after 'box' is emitted");var t=this._headers;this._headers=null,this._buffer(t.contentLen,(i=>{var n=s.decodeWithoutHeaders(t,i);e(n),this._pending--,this._kick()}))}ignore(){if(!this._headers)throw new Error("this function can only be called once after 'box' is emitted");var e=this._headers;this._headers=null,this._missing=e.contentLen,0===this._missing&&(this._ignoreEmpty=!0),this._cb=()=>{this._pending--,this._kick()}}_kick(){if(!this._pending&&(this._buf||this._str||this._readBox(),this._writeBuffer)){var e=this._writeCb,t=this._writeBuffer;this._writeBuffer=null,this._writeCb=null,this._write(t,null,e)}}}class c extends n.PassThrough{constructor(e){super(),this._parent=e,this.destroyed=!1}destroy(e){this.destroyed||(this.destroyed=!0,this._parent.destroy(e),e&&this.emit("error",e),this.emit("close"))}}t.exports=o}).call(this)}).call(this,e("buffer").Buffer)},{buffer:110,"mp4-box-encoding":289,"next-event":325,"readable-stream":307}],291:[function(e,t,i){(function(i){(function(){var n=e("readable-stream"),r=e("mp4-box-encoding"),s=e("queue-microtask");function a(){}class o extends n.Readable{constructor(e){super(e),this.destroyed=!1,this._finalized=!1,this._reading=!1,this._stream=null,this._drain=null,this._want=!1,this._onreadable=()=>{this._want&&(this._want=!1,this._read())},this._onend=()=>{this._stream=null}}mdat(e,t){this.mediaData(e,t)}mediaData(e,t){var i=new c(this);return this.box({type:"mdat",contentLength:e,encodeBufferLen:8,stream:i},t),i}box(e,t){if(t||(t=a),this.destroyed)return t(new Error("Encoder is destroyed"));var n;if(e.encodeBufferLen&&(n=i.alloc(e.encodeBufferLen)),e.stream)e.buffer=null,n=r.encode(e,n),this.push(n),this._stream=e.stream,this._stream.on("readable",this._onreadable),this._stream.on("end",this._onend),this._stream.on("end",t),this._forward();else{if(n=r.encode(e,n),this.push(n))return s(t);this._drain=t}}destroy(e){if(!this.destroyed){if(this.destroyed=!0,this._stream&&this._stream.destroy&&this._stream.destroy(),this._stream=null,this._drain){var t=this._drain;this._drain=null,t(e)}e&&this.emit("error",e),this.emit("close")}}finalize(){this._finalized=!0,this._stream||this._drain||this.push(null)}_forward(){if(this._stream)for(;!this.destroyed;){var e=this._stream.read();if(!e)return void(this._want=!!this._stream);if(!this.push(e))return}}_read(){if(!this._reading&&!this.destroyed){if(this._reading=!0,this._stream&&this._forward(),this._drain){var e=this._drain;this._drain=null,e()}this._reading=!1,this._finalized&&this.push(null)}}}class c extends n.PassThrough{constructor(e){super(),this._parent=e,this.destroyed=!1}destroy(e){this.destroyed||(this.destroyed=!0,this._parent.destroy(e),e&&this.emit("error",e),this.emit("close"))}}t.exports=o}).call(this)}).call(this,e("buffer").Buffer)},{buffer:110,"mp4-box-encoding":289,"queue-microtask":354,"readable-stream":307}],292:[function(e,t,i){const n=e("./decode"),r=e("./encode");i.decode=e=>new n(e),i.encode=e=>new r(e)},{"./decode":290,"./encode":291}],293:[function(e,t,i){arguments[4][29][0].apply(i,arguments)},{dup:29}],294:[function(e,t,i){arguments[4][30][0].apply(i,arguments)},{"./_stream_readable":296,"./_stream_writable":298,_process:341,dup:30,inherits:246}],295:[function(e,t,i){arguments[4][31][0].apply(i,arguments)},{"./_stream_transform":297,dup:31,inherits:246}],296:[function(e,t,i){arguments[4][32][0].apply(i,arguments)},{"../errors":293,"./_stream_duplex":294,"./internal/streams/async_iterator":299,"./internal/streams/buffer_list":300,"./internal/streams/destroy":301,"./internal/streams/from":303,"./internal/streams/state":305,"./internal/streams/stream":306,_process:341,buffer:110,dup:32,events:193,inherits:246,"string_decoder/":472,util:67}],297:[function(e,t,i){arguments[4][33][0].apply(i,arguments)},{"../errors":293,"./_stream_duplex":294,dup:33,inherits:246}],298:[function(e,t,i){arguments[4][34][0].apply(i,arguments)},{"../errors":293,"./_stream_duplex":294,"./internal/streams/destroy":301,"./internal/streams/state":305,"./internal/streams/stream":306,_process:341,buffer:110,dup:34,inherits:246,"util-deprecate":485}],299:[function(e,t,i){arguments[4][35][0].apply(i,arguments)},{"./end-of-stream":302,_process:341,dup:35}],300:[function(e,t,i){arguments[4][36][0].apply(i,arguments)},{buffer:110,dup:36,util:67}],301:[function(e,t,i){arguments[4][37][0].apply(i,arguments)},{_process:341,dup:37}],302:[function(e,t,i){arguments[4][38][0].apply(i,arguments)},{"../../../errors":293,dup:38}],303:[function(e,t,i){arguments[4][39][0].apply(i,arguments)},{dup:39}],304:[function(e,t,i){arguments[4][40][0].apply(i,arguments)},{"../../../errors":293,"./end-of-stream":302,dup:40}],305:[function(e,t,i){arguments[4][41][0].apply(i,arguments)},{"../../../errors":293,dup:41}],306:[function(e,t,i){arguments[4][42][0].apply(i,arguments)},{dup:42,events:193}],307:[function(e,t,i){arguments[4][43][0].apply(i,arguments)},{"./lib/_stream_duplex.js":294,"./lib/_stream_passthrough.js":295,"./lib/_stream_readable.js":296,"./lib/_stream_transform.js":297,"./lib/_stream_writable.js":298,"./lib/internal/streams/end-of-stream.js":302,"./lib/internal/streams/pipeline.js":304,dup:43}],308:[function(e,t,i){var n=1e3,r=60*n,s=60*r,a=24*s,o=7*a,c=365.25*a;function l(e,t,i,n){var r=t>=1.5*i;return Math.round(e/i)+" "+n+(r?"s":"")}t.exports=function(e,t){t=t||{};var i=typeof e;if("string"===i&&e.length>0)return function(e){if((e=String(e)).length>100)return;var t=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(!t)return;var i=parseFloat(t[1]);switch((t[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return i*c;case"weeks":case"week":case"w":return i*o;case"days":case"day":case"d":return i*a;case"hours":case"hour":case"hrs":case"hr":case"h":return i*s;case"minutes":case"minute":case"mins":case"min":case"m":return i*r;case"seconds":case"second":case"secs":case"sec":case"s":return i*n;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return i;default:return}}(e);if("number"===i&&isFinite(e))return t.long?function(e){var t=Math.abs(e);if(t>=a)return l(e,t,a,"day");if(t>=s)return l(e,t,s,"hour");if(t>=r)return l(e,t,r,"minute");if(t>=n)return l(e,t,n,"second");return e+" ms"}(e):function(e){var t=Math.abs(e);if(t>=a)return Math.round(e/a)+"d";if(t>=s)return Math.round(e/s)+"h";if(t>=r)return Math.round(e/r)+"m";if(t>=n)return Math.round(e/n)+"s";return e+"ms"}(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))}},{}],309:[function(e,t,i){ /*! multistream. MIT License. Feross Aboukhadijeh */ -const i=e("readable-stream"),r=e("once");function s(e){return a(e,{objectMode:!0,highWaterMark:16})}function o(e){return a(e)}function a(e,t){if(!e||"function"==typeof e||e._readableState)return e;const n=new i.Readable(t).wrap(e);return e.destroy&&(n.destroy=e.destroy.bind(e)),n}class c extends i.Readable{constructor(e,t){super({...t,autoDestroy:!0}),this._drained=!1,this._forwarding=!1,this._current=null,this._toStreams2=t&&t.objectMode?s:o,"function"==typeof e?this._queue=e:(this._queue=e.map(this._toStreams2),this._queue.forEach((e=>{"function"!=typeof e&&this._attachErrorListener(e)}))),this._next()}_read(){this._drained=!0,this._forward()}_forward(){if(this._forwarding||!this._drained||!this._current)return;let e;for(this._forwarding=!0;this._drained&&null!==(e=this._current.read());)this._drained=this.push(e);this._forwarding=!1}_destroy(e,t){let n=[];if(this._current&&n.push(this._current),"function"!=typeof this._queue&&(n=n.concat(this._queue)),0===n.length)t(e);else{let i=n.length,s=e;n.forEach((n=>{!function(e,t,n){if(!e.destroy||e.destroyed)n(t);else{const i=r((e=>n(e||t)));e.on("error",i).on("close",(()=>i())).destroy(t,i)}}(n,e,(e=>{s=s||e,0==--i&&t(s)}))}))}}_next(){if(this._current=null,"function"==typeof this._queue)this._queue(((e,t)=>{if(e)return this.destroy(e);t=this._toStreams2(t),this._attachErrorListener(t),this._gotNextStream(t)}));else{let e=this._queue.shift();"function"==typeof e&&(e=this._toStreams2(e()),this._attachErrorListener(e)),this._gotNextStream(e)}}_gotNextStream(e){if(!e)return void this.push(null);this._current=e,this._forward();const t=()=>{this._forward()},n=()=>{if(!e._readableState.ended&&!e.destroyed){const e=new Error("ERR_STREAM_PREMATURE_CLOSE");e.code="ERR_STREAM_PREMATURE_CLOSE",this.destroy(e)}},i=()=>{this._current=null,e.removeListener("readable",t),e.removeListener("end",i),e.removeListener("close",n),e.destroy(),this._next()};e.on("readable",t),e.once("end",i),e.once("close",n)}_attachErrorListener(e){if(!e)return;const t=n=>{e.removeListener("error",t),this.destroy(n)};e.once("error",t)}}c.obj=e=>new c(e,{objectMode:!0,highWaterMark:16}),t.exports=c},{once:327,"readable-stream":325}],311:[function(e,t,n){arguments[4][32][0].apply(n,arguments)},{dup:32}],312:[function(e,t,n){arguments[4][33][0].apply(n,arguments)},{"./_stream_readable":314,"./_stream_writable":316,_process:342,dup:33,inherits:249}],313:[function(e,t,n){arguments[4][34][0].apply(n,arguments)},{"./_stream_transform":315,dup:34,inherits:249}],314:[function(e,t,n){arguments[4][35][0].apply(n,arguments)},{"../errors":311,"./_stream_duplex":312,"./internal/streams/async_iterator":317,"./internal/streams/buffer_list":318,"./internal/streams/destroy":319,"./internal/streams/from":321,"./internal/streams/state":323,"./internal/streams/stream":324,_process:342,buffer:116,dup:35,events:196,inherits:249,"string_decoder/":481,util:73}],315:[function(e,t,n){arguments[4][36][0].apply(n,arguments)},{"../errors":311,"./_stream_duplex":312,dup:36,inherits:249}],316:[function(e,t,n){arguments[4][37][0].apply(n,arguments)},{"../errors":311,"./_stream_duplex":312,"./internal/streams/destroy":319,"./internal/streams/state":323,"./internal/streams/stream":324,_process:342,buffer:116,dup:37,inherits:249,"util-deprecate":500}],317:[function(e,t,n){arguments[4][38][0].apply(n,arguments)},{"./end-of-stream":320,_process:342,dup:38}],318:[function(e,t,n){arguments[4][39][0].apply(n,arguments)},{buffer:116,dup:39,util:73}],319:[function(e,t,n){arguments[4][40][0].apply(n,arguments)},{_process:342,dup:40}],320:[function(e,t,n){arguments[4][41][0].apply(n,arguments)},{"../../../errors":311,dup:41}],321:[function(e,t,n){arguments[4][42][0].apply(n,arguments)},{dup:42}],322:[function(e,t,n){arguments[4][43][0].apply(n,arguments)},{"../../../errors":311,"./end-of-stream":320,dup:43}],323:[function(e,t,n){arguments[4][44][0].apply(n,arguments)},{"../../../errors":311,dup:44}],324:[function(e,t,n){arguments[4][45][0].apply(n,arguments)},{dup:45,events:196}],325:[function(e,t,n){arguments[4][46][0].apply(n,arguments)},{"./lib/_stream_duplex.js":312,"./lib/_stream_passthrough.js":313,"./lib/_stream_readable.js":314,"./lib/_stream_transform.js":315,"./lib/_stream_writable.js":316,"./lib/internal/streams/end-of-stream.js":320,"./lib/internal/streams/pipeline.js":322,dup:46}],326:[function(e,t,n){t.exports=function(e,t){var n=null;return e.on(t,(function(e){if(n){var t=n;n=null,t(e)}})),function(e){n=e}}},{}],327:[function(e,t,n){var i=e("wrappy");function r(e){var t=function(){return t.called?t.value:(t.called=!0,t.value=e.apply(this,arguments))};return t.called=!1,t}function s(e){var t=function(){if(t.called)throw new Error(t.onceError);return t.called=!0,t.value=e.apply(this,arguments)},n=e.name||"Function wrapped with `once`";return t.onceError=n+" shouldn't be called more than once",t.called=!1,t}t.exports=i(r),t.exports.strict=i(s),r.proto=r((function(){Object.defineProperty(Function.prototype,"once",{value:function(){return r(this)},configurable:!0}),Object.defineProperty(Function.prototype,"onceStrict",{value:function(){return s(this)},configurable:!0})}))},{wrappy:529}],328:[function(e,t,n){t.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"}},{}],329:[function(e,t,n){"use strict";var i=e("asn1.js");n.certificate=e("./certificate");var r=i.define("RSAPrivateKey",(function(){this.seq().obj(this.key("version").int(),this.key("modulus").int(),this.key("publicExponent").int(),this.key("privateExponent").int(),this.key("prime1").int(),this.key("prime2").int(),this.key("exponent1").int(),this.key("exponent2").int(),this.key("coefficient").int())}));n.RSAPrivateKey=r;var s=i.define("RSAPublicKey",(function(){this.seq().obj(this.key("modulus").int(),this.key("publicExponent").int())}));n.RSAPublicKey=s;var o=i.define("SubjectPublicKeyInfo",(function(){this.seq().obj(this.key("algorithm").use(a),this.key("subjectPublicKey").bitstr())}));n.PublicKey=o;var a=i.define("AlgorithmIdentifier",(function(){this.seq().obj(this.key("algorithm").objid(),this.key("none").null_().optional(),this.key("curve").objid().optional(),this.key("params").seq().obj(this.key("p").int(),this.key("q").int(),this.key("g").int()).optional())})),c=i.define("PrivateKeyInfo",(function(){this.seq().obj(this.key("version").int(),this.key("algorithm").use(a),this.key("subjectPrivateKey").octstr())}));n.PrivateKey=c;var u=i.define("EncryptedPrivateKeyInfo",(function(){this.seq().obj(this.key("algorithm").seq().obj(this.key("id").objid(),this.key("decrypt").seq().obj(this.key("kde").seq().obj(this.key("id").objid(),this.key("kdeparams").seq().obj(this.key("salt").octstr(),this.key("iters").int())),this.key("cipher").seq().obj(this.key("algo").objid(),this.key("iv").octstr()))),this.key("subjectPrivateKey").octstr())}));n.EncryptedPrivateKey=u;var l=i.define("DSAPrivateKey",(function(){this.seq().obj(this.key("version").int(),this.key("p").int(),this.key("q").int(),this.key("g").int(),this.key("pub_key").int(),this.key("priv_key").int())}));n.DSAPrivateKey=l,n.DSAparam=i.define("DSAparam",(function(){this.int()}));var d=i.define("ECPrivateKey",(function(){this.seq().obj(this.key("version").int(),this.key("privateKey").octstr(),this.key("parameters").optional().explicit(0).use(f),this.key("publicKey").optional().explicit(1).bitstr())}));n.ECPrivateKey=d;var f=i.define("ECParameters",(function(){this.choice({namedCurve:this.objid()})}));n.signature=i.define("signature",(function(){this.seq().obj(this.key("r").int(),this.key("s").int())}))},{"./certificate":330,"asn1.js":4}],330:[function(e,t,n){"use strict";var i=e("asn1.js"),r=i.define("Time",(function(){this.choice({utcTime:this.utctime(),generalTime:this.gentime()})})),s=i.define("AttributeTypeValue",(function(){this.seq().obj(this.key("type").objid(),this.key("value").any())})),o=i.define("AlgorithmIdentifier",(function(){this.seq().obj(this.key("algorithm").objid(),this.key("parameters").optional(),this.key("curve").objid().optional())})),a=i.define("SubjectPublicKeyInfo",(function(){this.seq().obj(this.key("algorithm").use(o),this.key("subjectPublicKey").bitstr())})),c=i.define("RelativeDistinguishedName",(function(){this.setof(s)})),u=i.define("RDNSequence",(function(){this.seqof(c)})),l=i.define("Name",(function(){this.choice({rdnSequence:this.use(u)})})),d=i.define("Validity",(function(){this.seq().obj(this.key("notBefore").use(r),this.key("notAfter").use(r))})),f=i.define("Extension",(function(){this.seq().obj(this.key("extnID").objid(),this.key("critical").bool().def(!1),this.key("extnValue").octstr())})),p=i.define("TBSCertificate",(function(){this.seq().obj(this.key("version").explicit(0).int().optional(),this.key("serialNumber").int(),this.key("signature").use(o),this.key("issuer").use(l),this.key("validity").use(d),this.key("subject").use(l),this.key("subjectPublicKeyInfo").use(a),this.key("issuerUniqueID").implicit(1).bitstr().optional(),this.key("subjectUniqueID").implicit(2).bitstr().optional(),this.key("extensions").explicit(3).seqof(f).optional())})),h=i.define("X509Certificate",(function(){this.seq().obj(this.key("tbsCertificate").use(p),this.key("signatureAlgorithm").use(o),this.key("signatureValue").bitstr())}));t.exports=h},{"asn1.js":4}],331:[function(e,t,n){var i=/Proc-Type: 4,ENCRYPTED[\n\r]+DEK-Info: AES-((?:128)|(?:192)|(?:256))-CBC,([0-9A-H]+)[\n\r]+([0-9A-z\n\r+/=]+)[\n\r]+/m,r=/^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----/m,s=/^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----([0-9A-z\n\r+/=]+)-----END \1-----$/m,o=e("evp_bytestokey"),a=e("browserify-aes"),c=e("safe-buffer").Buffer;t.exports=function(e,t){var n,u=e.toString(),l=u.match(i);if(l){var d="aes"+l[1],f=c.from(l[2],"hex"),p=c.from(l[3].replace(/[\r\n]/g,""),"base64"),h=o(t,f.slice(0,8),parseInt(l[1],10)).key,m=[],b=a.createDecipheriv(d,h,f);m.push(b.update(p)),m.push(b.final()),n=c.concat(m)}else{var g=u.match(s);n=c.from(g[2].replace(/[\r\n]/g,""),"base64")}return{tag:u.match(r)[1],data:n}}},{"browserify-aes":76,evp_bytestokey:197,"safe-buffer":386}],332:[function(e,t,n){var i=e("./asn1"),r=e("./aesid.json"),s=e("./fixProc"),o=e("browserify-aes"),a=e("pbkdf2"),c=e("safe-buffer").Buffer;function u(e){var t;"object"!=typeof e||c.isBuffer(e)||(t=e.passphrase,e=e.key),"string"==typeof e&&(e=c.from(e));var n,u,l=s(e,t),d=l.tag,f=l.data;switch(d){case"CERTIFICATE":u=i.certificate.decode(f,"der").tbsCertificate.subjectPublicKeyInfo;case"PUBLIC KEY":switch(u||(u=i.PublicKey.decode(f,"der")),n=u.algorithm.algorithm.join(".")){case"1.2.840.113549.1.1.1":return i.RSAPublicKey.decode(u.subjectPublicKey.data,"der");case"1.2.840.10045.2.1":return u.subjectPrivateKey=u.subjectPublicKey,{type:"ec",data:u};case"1.2.840.10040.4.1":return u.algorithm.params.pub_key=i.DSAparam.decode(u.subjectPublicKey.data,"der"),{type:"dsa",data:u.algorithm.params};default:throw new Error("unknown key id "+n)}case"ENCRYPTED PRIVATE KEY":f=function(e,t){var n=e.algorithm.decrypt.kde.kdeparams.salt,i=parseInt(e.algorithm.decrypt.kde.kdeparams.iters.toString(),10),s=r[e.algorithm.decrypt.cipher.algo.join(".")],u=e.algorithm.decrypt.cipher.iv,l=e.subjectPrivateKey,d=parseInt(s.split("-")[1],10)/8,f=a.pbkdf2Sync(t,n,i,d,"sha1"),p=o.createDecipheriv(s,f,u),h=[];return h.push(p.update(l)),h.push(p.final()),c.concat(h)}(f=i.EncryptedPrivateKey.decode(f,"der"),t);case"PRIVATE KEY":switch(n=(u=i.PrivateKey.decode(f,"der")).algorithm.algorithm.join(".")){case"1.2.840.113549.1.1.1":return i.RSAPrivateKey.decode(u.subjectPrivateKey,"der");case"1.2.840.10045.2.1":return{curve:u.algorithm.curve,privateKey:i.ECPrivateKey.decode(u.subjectPrivateKey,"der").privateKey};case"1.2.840.10040.4.1":return u.algorithm.params.priv_key=i.DSAparam.decode(u.subjectPrivateKey,"der"),{type:"dsa",params:u.algorithm.params};default:throw new Error("unknown key id "+n)}case"RSA PUBLIC KEY":return i.RSAPublicKey.decode(f,"der");case"RSA PRIVATE KEY":return i.RSAPrivateKey.decode(f,"der");case"DSA PRIVATE KEY":return{type:"dsa",params:i.DSAPrivateKey.decode(f,"der")};case"EC PRIVATE KEY":return{curve:(f=i.ECPrivateKey.decode(f,"der")).parameters.value,privateKey:f.privateKey};default:throw new Error("unknown key type "+d)}}t.exports=u,u.signature=i.signature},{"./aesid.json":328,"./asn1":329,"./fixProc":331,"browserify-aes":76,pbkdf2:335,"safe-buffer":386}],333:[function(e,t,n){(function(n){(function(){ +const n=e("readable-stream"),r=e("once");function s(e){return o(e,{objectMode:!0,highWaterMark:16})}function a(e){return o(e)}function o(e,t){if(!e||"function"==typeof e||e._readableState)return e;const i=new n.Readable(t).wrap(e);return e.destroy&&(i.destroy=e.destroy.bind(e)),i}class c extends n.Readable{constructor(e,t){super({...t,autoDestroy:!0}),this._drained=!1,this._forwarding=!1,this._current=null,this._toStreams2=t&&t.objectMode?s:a,"function"==typeof e?this._queue=e:(this._queue=e.map(this._toStreams2),this._queue.forEach((e=>{"function"!=typeof e&&this._attachErrorListener(e)}))),this._next()}_read(){this._drained=!0,this._forward()}_forward(){if(this._forwarding||!this._drained||!this._current)return;let e;for(this._forwarding=!0;this._drained&&null!==(e=this._current.read());)this._drained=this.push(e);this._forwarding=!1}_destroy(e,t){let i=[];if(this._current&&i.push(this._current),"function"!=typeof this._queue&&(i=i.concat(this._queue)),0===i.length)t(e);else{let n=i.length,s=e;i.forEach((i=>{!function(e,t,i){if(!e.destroy||e.destroyed)i(t);else{const n=r((e=>i(e||t)));e.on("error",n).on("close",(()=>n())).destroy(t,n)}}(i,e,(e=>{s=s||e,0==--n&&t(s)}))}))}}_next(){if(this._current=null,"function"==typeof this._queue)this._queue(((e,t)=>{if(e)return this.destroy(e);t=this._toStreams2(t),this._attachErrorListener(t),this._gotNextStream(t)}));else{let e=this._queue.shift();"function"==typeof e&&(e=this._toStreams2(e()),this._attachErrorListener(e)),this._gotNextStream(e)}}_gotNextStream(e){if(!e)return void this.push(null);this._current=e,this._forward();const t=()=>{this._forward()},i=()=>{if(!e._readableState.ended&&!e.destroyed){const e=new Error("ERR_STREAM_PREMATURE_CLOSE");e.code="ERR_STREAM_PREMATURE_CLOSE",this.destroy(e)}},n=()=>{this._current=null,e.removeListener("readable",t),e.removeListener("end",n),e.removeListener("close",i),e.destroy(),this._next()};e.on("readable",t),e.once("end",n),e.once("close",i)}_attachErrorListener(e){if(!e)return;const t=i=>{e.removeListener("error",t),this.destroy(i)};e.once("error",t)}}c.obj=e=>new c(e,{objectMode:!0,highWaterMark:16}),t.exports=c},{once:326,"readable-stream":324}],310:[function(e,t,i){arguments[4][29][0].apply(i,arguments)},{dup:29}],311:[function(e,t,i){arguments[4][30][0].apply(i,arguments)},{"./_stream_readable":313,"./_stream_writable":315,_process:341,dup:30,inherits:246}],312:[function(e,t,i){arguments[4][31][0].apply(i,arguments)},{"./_stream_transform":314,dup:31,inherits:246}],313:[function(e,t,i){arguments[4][32][0].apply(i,arguments)},{"../errors":310,"./_stream_duplex":311,"./internal/streams/async_iterator":316,"./internal/streams/buffer_list":317,"./internal/streams/destroy":318,"./internal/streams/from":320,"./internal/streams/state":322,"./internal/streams/stream":323,_process:341,buffer:110,dup:32,events:193,inherits:246,"string_decoder/":472,util:67}],314:[function(e,t,i){arguments[4][33][0].apply(i,arguments)},{"../errors":310,"./_stream_duplex":311,dup:33,inherits:246}],315:[function(e,t,i){arguments[4][34][0].apply(i,arguments)},{"../errors":310,"./_stream_duplex":311,"./internal/streams/destroy":318,"./internal/streams/state":322,"./internal/streams/stream":323,_process:341,buffer:110,dup:34,inherits:246,"util-deprecate":485}],316:[function(e,t,i){arguments[4][35][0].apply(i,arguments)},{"./end-of-stream":319,_process:341,dup:35}],317:[function(e,t,i){arguments[4][36][0].apply(i,arguments)},{buffer:110,dup:36,util:67}],318:[function(e,t,i){arguments[4][37][0].apply(i,arguments)},{_process:341,dup:37}],319:[function(e,t,i){arguments[4][38][0].apply(i,arguments)},{"../../../errors":310,dup:38}],320:[function(e,t,i){arguments[4][39][0].apply(i,arguments)},{dup:39}],321:[function(e,t,i){arguments[4][40][0].apply(i,arguments)},{"../../../errors":310,"./end-of-stream":319,dup:40}],322:[function(e,t,i){arguments[4][41][0].apply(i,arguments)},{"../../../errors":310,dup:41}],323:[function(e,t,i){arguments[4][42][0].apply(i,arguments)},{dup:42,events:193}],324:[function(e,t,i){arguments[4][43][0].apply(i,arguments)},{"./lib/_stream_duplex.js":311,"./lib/_stream_passthrough.js":312,"./lib/_stream_readable.js":313,"./lib/_stream_transform.js":314,"./lib/_stream_writable.js":315,"./lib/internal/streams/end-of-stream.js":319,"./lib/internal/streams/pipeline.js":321,dup:43}],325:[function(e,t,i){t.exports=function(e,t){var i=null;return e.on(t,(function(e){if(i){var t=i;i=null,t(e)}})),function(e){i=e}}},{}],326:[function(e,t,i){var n=e("wrappy");function r(e){var t=function(){return t.called?t.value:(t.called=!0,t.value=e.apply(this,arguments))};return t.called=!1,t}function s(e){var t=function(){if(t.called)throw new Error(t.onceError);return t.called=!0,t.value=e.apply(this,arguments)},i=e.name||"Function wrapped with `once`";return t.onceError=i+" shouldn't be called more than once",t.called=!1,t}t.exports=n(r),t.exports.strict=n(s),r.proto=r((function(){Object.defineProperty(Function.prototype,"once",{value:function(){return r(this)},configurable:!0}),Object.defineProperty(Function.prototype,"onceStrict",{value:function(){return s(this)},configurable:!0})}))},{wrappy:496}],327:[function(e,t,i){t.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"}},{}],328:[function(e,t,i){"use strict";var n=e("asn1.js");i.certificate=e("./certificate");var r=n.define("RSAPrivateKey",(function(){this.seq().obj(this.key("version").int(),this.key("modulus").int(),this.key("publicExponent").int(),this.key("privateExponent").int(),this.key("prime1").int(),this.key("prime2").int(),this.key("exponent1").int(),this.key("exponent2").int(),this.key("coefficient").int())}));i.RSAPrivateKey=r;var s=n.define("RSAPublicKey",(function(){this.seq().obj(this.key("modulus").int(),this.key("publicExponent").int())}));i.RSAPublicKey=s;var a=n.define("SubjectPublicKeyInfo",(function(){this.seq().obj(this.key("algorithm").use(o),this.key("subjectPublicKey").bitstr())}));i.PublicKey=a;var o=n.define("AlgorithmIdentifier",(function(){this.seq().obj(this.key("algorithm").objid(),this.key("none").null_().optional(),this.key("curve").objid().optional(),this.key("params").seq().obj(this.key("p").int(),this.key("q").int(),this.key("g").int()).optional())})),c=n.define("PrivateKeyInfo",(function(){this.seq().obj(this.key("version").int(),this.key("algorithm").use(o),this.key("subjectPrivateKey").octstr())}));i.PrivateKey=c;var l=n.define("EncryptedPrivateKeyInfo",(function(){this.seq().obj(this.key("algorithm").seq().obj(this.key("id").objid(),this.key("decrypt").seq().obj(this.key("kde").seq().obj(this.key("id").objid(),this.key("kdeparams").seq().obj(this.key("salt").octstr(),this.key("iters").int())),this.key("cipher").seq().obj(this.key("algo").objid(),this.key("iv").octstr()))),this.key("subjectPrivateKey").octstr())}));i.EncryptedPrivateKey=l;var u=n.define("DSAPrivateKey",(function(){this.seq().obj(this.key("version").int(),this.key("p").int(),this.key("q").int(),this.key("g").int(),this.key("pub_key").int(),this.key("priv_key").int())}));i.DSAPrivateKey=u,i.DSAparam=n.define("DSAparam",(function(){this.int()}));var p=n.define("ECPrivateKey",(function(){this.seq().obj(this.key("version").int(),this.key("privateKey").octstr(),this.key("parameters").optional().explicit(0).use(d),this.key("publicKey").optional().explicit(1).bitstr())}));i.ECPrivateKey=p;var d=n.define("ECParameters",(function(){this.choice({namedCurve:this.objid()})}));i.signature=n.define("signature",(function(){this.seq().obj(this.key("r").int(),this.key("s").int())}))},{"./certificate":329,"asn1.js":4}],329:[function(e,t,i){"use strict";var n=e("asn1.js"),r=n.define("Time",(function(){this.choice({utcTime:this.utctime(),generalTime:this.gentime()})})),s=n.define("AttributeTypeValue",(function(){this.seq().obj(this.key("type").objid(),this.key("value").any())})),a=n.define("AlgorithmIdentifier",(function(){this.seq().obj(this.key("algorithm").objid(),this.key("parameters").optional(),this.key("curve").objid().optional())})),o=n.define("SubjectPublicKeyInfo",(function(){this.seq().obj(this.key("algorithm").use(a),this.key("subjectPublicKey").bitstr())})),c=n.define("RelativeDistinguishedName",(function(){this.setof(s)})),l=n.define("RDNSequence",(function(){this.seqof(c)})),u=n.define("Name",(function(){this.choice({rdnSequence:this.use(l)})})),p=n.define("Validity",(function(){this.seq().obj(this.key("notBefore").use(r),this.key("notAfter").use(r))})),d=n.define("Extension",(function(){this.seq().obj(this.key("extnID").objid(),this.key("critical").bool().def(!1),this.key("extnValue").octstr())})),f=n.define("TBSCertificate",(function(){this.seq().obj(this.key("version").explicit(0).int().optional(),this.key("serialNumber").int(),this.key("signature").use(a),this.key("issuer").use(u),this.key("validity").use(p),this.key("subject").use(u),this.key("subjectPublicKeyInfo").use(o),this.key("issuerUniqueID").implicit(1).bitstr().optional(),this.key("subjectUniqueID").implicit(2).bitstr().optional(),this.key("extensions").explicit(3).seqof(d).optional())})),h=n.define("X509Certificate",(function(){this.seq().obj(this.key("tbsCertificate").use(f),this.key("signatureAlgorithm").use(a),this.key("signatureValue").bitstr())}));t.exports=h},{"asn1.js":4}],330:[function(e,t,i){var n=/Proc-Type: 4,ENCRYPTED[\n\r]+DEK-Info: AES-((?:128)|(?:192)|(?:256))-CBC,([0-9A-H]+)[\n\r]+([0-9A-z\n\r+/=]+)[\n\r]+/m,r=/^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----/m,s=/^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----([0-9A-z\n\r+/=]+)-----END \1-----$/m,a=e("evp_bytestokey"),o=e("browserify-aes"),c=e("safe-buffer").Buffer;t.exports=function(e,t){var i,l=e.toString(),u=l.match(n);if(u){var p="aes"+u[1],d=c.from(u[2],"hex"),f=c.from(u[3].replace(/[\r\n]/g,""),"base64"),h=a(t,d.slice(0,8),parseInt(u[1],10)).key,m=[],b=o.createDecipheriv(p,h,d);m.push(b.update(f)),m.push(b.final()),i=c.concat(m)}else{var v=l.match(s);i=c.from(v[2].replace(/[\r\n]/g,""),"base64")}return{tag:l.match(r)[1],data:i}}},{"browserify-aes":70,evp_bytestokey:194,"safe-buffer":383}],331:[function(e,t,i){var n=e("./asn1"),r=e("./aesid.json"),s=e("./fixProc"),a=e("browserify-aes"),o=e("pbkdf2"),c=e("safe-buffer").Buffer;function l(e){var t;"object"!=typeof e||c.isBuffer(e)||(t=e.passphrase,e=e.key),"string"==typeof e&&(e=c.from(e));var i,l,u=s(e,t),p=u.tag,d=u.data;switch(p){case"CERTIFICATE":l=n.certificate.decode(d,"der").tbsCertificate.subjectPublicKeyInfo;case"PUBLIC KEY":switch(l||(l=n.PublicKey.decode(d,"der")),i=l.algorithm.algorithm.join(".")){case"1.2.840.113549.1.1.1":return n.RSAPublicKey.decode(l.subjectPublicKey.data,"der");case"1.2.840.10045.2.1":return l.subjectPrivateKey=l.subjectPublicKey,{type:"ec",data:l};case"1.2.840.10040.4.1":return l.algorithm.params.pub_key=n.DSAparam.decode(l.subjectPublicKey.data,"der"),{type:"dsa",data:l.algorithm.params};default:throw new Error("unknown key id "+i)}case"ENCRYPTED PRIVATE KEY":d=function(e,t){var i=e.algorithm.decrypt.kde.kdeparams.salt,n=parseInt(e.algorithm.decrypt.kde.kdeparams.iters.toString(),10),s=r[e.algorithm.decrypt.cipher.algo.join(".")],l=e.algorithm.decrypt.cipher.iv,u=e.subjectPrivateKey,p=parseInt(s.split("-")[1],10)/8,d=o.pbkdf2Sync(t,i,n,p,"sha1"),f=a.createDecipheriv(s,d,l),h=[];return h.push(f.update(u)),h.push(f.final()),c.concat(h)}(d=n.EncryptedPrivateKey.decode(d,"der"),t);case"PRIVATE KEY":switch(i=(l=n.PrivateKey.decode(d,"der")).algorithm.algorithm.join(".")){case"1.2.840.113549.1.1.1":return n.RSAPrivateKey.decode(l.subjectPrivateKey,"der");case"1.2.840.10045.2.1":return{curve:l.algorithm.curve,privateKey:n.ECPrivateKey.decode(l.subjectPrivateKey,"der").privateKey};case"1.2.840.10040.4.1":return l.algorithm.params.priv_key=n.DSAparam.decode(l.subjectPrivateKey,"der"),{type:"dsa",params:l.algorithm.params};default:throw new Error("unknown key id "+i)}case"RSA PUBLIC KEY":return n.RSAPublicKey.decode(d,"der");case"RSA PRIVATE KEY":return n.RSAPrivateKey.decode(d,"der");case"DSA PRIVATE KEY":return{type:"dsa",params:n.DSAPrivateKey.decode(d,"der")};case"EC PRIVATE KEY":return{curve:(d=n.ECPrivateKey.decode(d,"der")).parameters.value,privateKey:d.privateKey};default:throw new Error("unknown key type "+p)}}t.exports=l,l.signature=n.signature},{"./aesid.json":327,"./asn1":328,"./fixProc":330,"browserify-aes":70,pbkdf2:334,"safe-buffer":383}],332:[function(e,t,i){(function(i){(function(){ /*! parse-torrent. MIT License. WebTorrent LLC */ -const i=e("bencode"),r=e("blob-to-buffer"),s=e("fs"),o=e("simple-get"),a=e("magnet-uri"),c=e("path"),u=e("simple-sha1"),l=e("queue-microtask");function d(e){if("string"==typeof e&&/^(stream-)?magnet:/.test(e)){const t=a(e);if(!t.infoHash)throw new Error("Invalid torrent identifier");return t}if("string"==typeof e&&(/^[a-f0-9]{40}$/i.test(e)||/^[a-z2-7]{32}$/i.test(e)))return a(`magnet:?xt=urn:btih:${e}`);if(n.isBuffer(e)&&20===e.length)return a(`magnet:?xt=urn:btih:${e.toString("hex")}`);if(n.isBuffer(e))return function(e){n.isBuffer(e)&&(e=i.decode(e));p(e.info,"info"),p(e.info["name.utf-8"]||e.info.name,"info.name"),p(e.info["piece length"],"info['piece length']"),p(e.info.pieces,"info.pieces"),e.info.files?e.info.files.forEach((e=>{p("number"==typeof e.length,"info.files[0].length"),p(e["path.utf-8"]||e.path,"info.files[0].path")})):p("number"==typeof e.info.length,"info.length");const t={info:e.info,infoBuffer:i.encode(e.info),name:(e.info["name.utf-8"]||e.info.name).toString(),announce:[]};t.infoHash=u.sync(t.infoBuffer),t.infoHashBuffer=n.from(t.infoHash,"hex"),void 0!==e.info.private&&(t.private=!!e.info.private);e["creation date"]&&(t.created=new Date(1e3*e["creation date"]));e["created by"]&&(t.createdBy=e["created by"].toString());n.isBuffer(e.comment)&&(t.comment=e.comment.toString());Array.isArray(e["announce-list"])&&e["announce-list"].length>0?e["announce-list"].forEach((e=>{e.forEach((e=>{t.announce.push(e.toString())}))})):e.announce&&t.announce.push(e.announce.toString());n.isBuffer(e["url-list"])&&(e["url-list"]=e["url-list"].length>0?[e["url-list"]]:[]);t.urlList=(e["url-list"]||[]).map((e=>e.toString())),t.announce=Array.from(new Set(t.announce)),t.urlList=Array.from(new Set(t.urlList));const r=e.info.files||[e.info];t.files=r.map(((e,n)=>{const i=[].concat(t.name,e["path.utf-8"]||e.path||[]).map((e=>e.toString()));return{path:c.join.apply(null,[c.sep].concat(i)).slice(1),name:i[i.length-1],length:e.length,offset:r.slice(0,n).reduce(f,0)}})),t.length=r.reduce(f,0);const s=t.files[t.files.length-1];return t.pieceLength=e.info["piece length"],t.lastPieceLength=(s.offset+s.length)%t.pieceLength||t.pieceLength,t.pieces=function(e){const t=[];for(let n=0;n{i(null,a)})):(c=t,"undefined"!=typeof Blob&&c instanceof Blob?r(t,((e,t)=>{if(e)return i(new Error(`Error converting Blob: ${e.message}`));u(t)})):"function"==typeof o&&/^https?:/.test(t)?(n=Object.assign({url:t,timeout:3e4,headers:{"user-agent":"WebTorrent (https://webtorrent.io)"}},n),o.concat(n,((e,t,n)=>{if(e)return i(new Error(`Error downloading torrent: ${e.message}`));u(n)}))):"function"==typeof s.readFile&&"string"==typeof t?s.readFile(t,((e,t)=>{if(e)return i(new Error("Invalid torrent identifier"));u(t)})):l((()=>{i(new Error("Invalid torrent identifier"))})));var c;function u(e){try{a=d(e)}catch(e){return i(e)}a&&a.infoHash?i(null,a):i(new Error("Invalid torrent identifier"))}},t.exports.toMagnetURI=a.encode,t.exports.toTorrentFile=function(e){const t={info:e.info};t["announce-list"]=(e.announce||[]).map((e=>(t.announce||(t.announce=e),[e=n.from(e,"utf8")]))),t["url-list"]=e.urlList||[],void 0!==e.private&&(t.private=Number(e.private));e.created&&(t["creation date"]=e.created.getTime()/1e3|0);e.createdBy&&(t["created by"]=e.createdBy);e.comment&&(t.comment=e.comment);return i.encode(t)},n.alloc(0)}).call(this)}).call(this,e("buffer").Buffer)},{bencode:23,"blob-to-buffer":54,buffer:116,fs:73,"magnet-uri":263,path:334,"queue-microtask":355,"simple-get":397,"simple-sha1":417}],334:[function(e,t,n){(function(e){(function(){"use strict";function n(e){if("string"!=typeof e)throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}function i(e,t){for(var n,i="",r=0,s=-1,o=0,a=0;a<=e.length;++a){if(a2){var c=i.lastIndexOf("/");if(c!==i.length-1){-1===c?(i="",r=0):r=(i=i.slice(0,c)).length-1-i.lastIndexOf("/"),s=a,o=0;continue}}else if(2===i.length||1===i.length){i="",r=0,s=a,o=0;continue}t&&(i.length>0?i+="/..":i="..",r=2)}else i.length>0?i+="/"+e.slice(s+1,a):i=e.slice(s+1,a),r=a-s-1;s=a,o=0}else 46===n&&-1!==o?++o:o=-1}return i}var r={resolve:function(){for(var t,r="",s=!1,o=arguments.length-1;o>=-1&&!s;o--){var a;o>=0?a=arguments[o]:(void 0===t&&(t=e.cwd()),a=t),n(a),0!==a.length&&(r=a+"/"+r,s=47===a.charCodeAt(0))}return r=i(r,!s),s?r.length>0?"/"+r:"/":r.length>0?r:"."},normalize:function(e){if(n(e),0===e.length)return".";var t=47===e.charCodeAt(0),r=47===e.charCodeAt(e.length-1);return 0!==(e=i(e,!t)).length||t||(e="."),e.length>0&&r&&(e+="/"),t?"/"+e:e},isAbsolute:function(e){return n(e),e.length>0&&47===e.charCodeAt(0)},join:function(){if(0===arguments.length)return".";for(var e,t=0;t0&&(void 0===e?e=i:e+="/"+i)}return void 0===e?".":r.normalize(e)},relative:function(e,t){if(n(e),n(t),e===t)return"";if((e=r.resolve(e))===(t=r.resolve(t)))return"";for(var i=1;iu){if(47===t.charCodeAt(a+d))return t.slice(a+d+1);if(0===d)return t.slice(a+d)}else o>u&&(47===e.charCodeAt(i+d)?l=d:0===d&&(l=0));break}var f=e.charCodeAt(i+d);if(f!==t.charCodeAt(a+d))break;47===f&&(l=d)}var p="";for(d=i+l+1;d<=s;++d)d!==s&&47!==e.charCodeAt(d)||(0===p.length?p+="..":p+="/..");return p.length>0?p+t.slice(a+l):(a+=l,47===t.charCodeAt(a)&&++a,t.slice(a))},_makeLong:function(e){return e},dirname:function(e){if(n(e),0===e.length)return".";for(var t=e.charCodeAt(0),i=47===t,r=-1,s=!0,o=e.length-1;o>=1;--o)if(47===(t=e.charCodeAt(o))){if(!s){r=o;break}}else s=!1;return-1===r?i?"/":".":i&&1===r?"//":e.slice(0,r)},basename:function(e,t){if(void 0!==t&&"string"!=typeof t)throw new TypeError('"ext" argument must be a string');n(e);var i,r=0,s=-1,o=!0;if(void 0!==t&&t.length>0&&t.length<=e.length){if(t.length===e.length&&t===e)return"";var a=t.length-1,c=-1;for(i=e.length-1;i>=0;--i){var u=e.charCodeAt(i);if(47===u){if(!o){r=i+1;break}}else-1===c&&(o=!1,c=i+1),a>=0&&(u===t.charCodeAt(a)?-1==--a&&(s=i):(a=-1,s=c))}return r===s?s=c:-1===s&&(s=e.length),e.slice(r,s)}for(i=e.length-1;i>=0;--i)if(47===e.charCodeAt(i)){if(!o){r=i+1;break}}else-1===s&&(o=!1,s=i+1);return-1===s?"":e.slice(r,s)},extname:function(e){n(e);for(var t=-1,i=0,r=-1,s=!0,o=0,a=e.length-1;a>=0;--a){var c=e.charCodeAt(a);if(47!==c)-1===r&&(s=!1,r=a+1),46===c?-1===t?t=a:1!==o&&(o=1):-1!==t&&(o=-1);else if(!s){i=a+1;break}}return-1===t||-1===r||0===o||1===o&&t===r-1&&t===i+1?"":e.slice(t,r)},format:function(e){if(null===e||"object"!=typeof e)throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof e);return function(e,t){var n=t.dir||t.root,i=t.base||(t.name||"")+(t.ext||"");return n?n===t.root?n+i:n+e+i:i}("/",e)},parse:function(e){n(e);var t={root:"",dir:"",base:"",ext:"",name:""};if(0===e.length)return t;var i,r=e.charCodeAt(0),s=47===r;s?(t.root="/",i=1):i=0;for(var o=-1,a=0,c=-1,u=!0,l=e.length-1,d=0;l>=i;--l)if(47!==(r=e.charCodeAt(l)))-1===c&&(u=!1,c=l+1),46===r?-1===o?o=l:1!==d&&(d=1):-1!==o&&(d=-1);else if(!u){a=l+1;break}return-1===o||-1===c||0===d||1===d&&o===c-1&&o===a+1?-1!==c&&(t.base=t.name=0===a&&s?e.slice(1,c):e.slice(a,c)):(0===a&&s?(t.name=e.slice(1,o),t.base=e.slice(1,c)):(t.name=e.slice(a,o),t.base=e.slice(a,c)),t.ext=e.slice(o,c)),a>0?t.dir=e.slice(0,a-1):s&&(t.dir="/"),t},sep:"/",delimiter:":",win32:null,posix:null};r.posix=r,t.exports=r}).call(this)}).call(this,e("_process"))},{_process:342}],335:[function(e,t,n){n.pbkdf2=e("./lib/async"),n.pbkdf2Sync=e("./lib/sync")},{"./lib/async":336,"./lib/sync":339}],336:[function(e,t,n){(function(n){(function(){var i,r,s=e("safe-buffer").Buffer,o=e("./precondition"),a=e("./default-encoding"),c=e("./sync"),u=e("./to-buffer"),l=n.crypto&&n.crypto.subtle,d={sha:"SHA-1","sha-1":"SHA-1",sha1:"SHA-1",sha256:"SHA-256","sha-256":"SHA-256",sha384:"SHA-384","sha-384":"SHA-384","sha-512":"SHA-512",sha512:"SHA-512"},f=[];function p(){return r||(r=n.process&&n.process.nextTick?n.process.nextTick:n.queueMicrotask?n.queueMicrotask:n.setImmediate?n.setImmediate:n.setTimeout)}function h(e,t,n,i,r){return l.importKey("raw",e,{name:"PBKDF2"},!1,["deriveBits"]).then((function(e){return l.deriveBits({name:"PBKDF2",salt:t,iterations:n,hash:{name:r}},e,i<<3)})).then((function(e){return s.from(e)}))}t.exports=function(e,t,r,m,b,g){"function"==typeof b&&(g=b,b=void 0);var v=d[(b=b||"sha1").toLowerCase()];if(v&&"function"==typeof n.Promise){if(o(r,m),e=u(e,a,"Password"),t=u(t,a,"Salt"),"function"!=typeof g)throw new Error("No callback provided to pbkdf2");!function(e,t){e.then((function(e){p()((function(){t(null,e)}))}),(function(e){p()((function(){t(e)}))}))}(function(e){if(n.process&&!n.process.browser)return Promise.resolve(!1);if(!l||!l.importKey||!l.deriveBits)return Promise.resolve(!1);if(void 0!==f[e])return f[e];var t=h(i=i||s.alloc(8),i,10,128,e).then((function(){return!0})).catch((function(){return!1}));return f[e]=t,t}(v).then((function(n){return n?h(e,t,r,m,v):c(e,t,r,m,b)})),g)}else p()((function(){var n;try{n=c(e,t,r,m,b)}catch(e){return g(e)}g(null,n)}))}}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./default-encoding":337,"./precondition":338,"./sync":339,"./to-buffer":340,"safe-buffer":386}],337:[function(e,t,n){(function(e,n){(function(){var i;if(n.process&&n.process.browser)i="utf-8";else if(n.process&&n.process.version){i=parseInt(e.version.split(".")[0].slice(1),10)>=6?"utf-8":"binary"}else i="utf-8";t.exports=i}).call(this)}).call(this,e("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{_process:342}],338:[function(e,t,n){var i=Math.pow(2,30)-1;t.exports=function(e,t){if("number"!=typeof e)throw new TypeError("Iterations not a number");if(e<0)throw new TypeError("Bad iterations");if("number"!=typeof t)throw new TypeError("Key length not a number");if(t<0||t>i||t!=t)throw new TypeError("Bad key length")}},{}],339:[function(e,t,n){var i=e("create-hash/md5"),r=e("ripemd160"),s=e("sha.js"),o=e("safe-buffer").Buffer,a=e("./precondition"),c=e("./default-encoding"),u=e("./to-buffer"),l=o.alloc(128),d={md5:16,sha1:20,sha224:28,sha256:32,sha384:48,sha512:64,rmd160:20,ripemd160:20};function f(e,t,n){var a=function(e){function t(t){return s(e).update(t).digest()}function n(e){return(new r).update(e).digest()}return"rmd160"===e||"ripemd160"===e?n:"md5"===e?i:t}(e),c="sha512"===e||"sha384"===e?128:64;t.length>c?t=a(t):t.length1)for(var n=1;nh||new o(t).cmp(p.modulus)>=0)throw new Error("decryption error");f=n?u(new o(t),p):a(t,p);var m=l.alloc(h-f.length);if(f=l.concat([m,f],h),4===d)return function(e,t){var n=e.modulus.byteLength(),i=c("sha1").update(l.alloc(0)).digest(),o=i.length;if(0!==t[0])throw new Error("decryption error");var a=t.slice(1,o+1),u=t.slice(o+1),d=s(a,r(u,o)),f=s(u,r(d,n-o-1));if(function(e,t){e=l.from(e),t=l.from(t);var n=0,i=e.length;e.length!==t.length&&(n++,i=Math.min(e.length,t.length));var r=-1;for(;++r=t.length){s++;break}var o=t.slice(2,r-1);("0002"!==i.toString("hex")&&!n||"0001"!==i.toString("hex")&&n)&&s++;o.length<8&&s++;if(s)throw new Error("decryption error");return t.slice(r)}(0,f,n);if(3===d)return f;throw new Error("unknown padding")}},{"./mgf":344,"./withPublic":348,"./xor":349,"bn.js":345,"browserify-rsa":94,"create-hash":145,"parse-asn1":332,"safe-buffer":386}],347:[function(e,t,n){var i=e("parse-asn1"),r=e("randombytes"),s=e("create-hash"),o=e("./mgf"),a=e("./xor"),c=e("bn.js"),u=e("./withPublic"),l=e("browserify-rsa"),d=e("safe-buffer").Buffer;t.exports=function(e,t,n){var f;f=e.padding?e.padding:n?1:4;var p,h=i(e);if(4===f)p=function(e,t){var n=e.modulus.byteLength(),i=t.length,u=s("sha1").update(d.alloc(0)).digest(),l=u.length,f=2*l;if(i>n-f-2)throw new Error("message too long");var p=d.alloc(n-i-f-2),h=n-l-1,m=r(l),b=a(d.concat([u,p,d.alloc(1,1),t],h),o(m,h)),g=a(m,o(b,l));return new c(d.concat([d.alloc(1),g,b],n))}(h,t);else if(1===f)p=function(e,t,n){var i,s=t.length,o=e.modulus.byteLength();if(s>o-11)throw new Error("message too long");i=n?d.alloc(o-s-3,255):function(e){var t,n=d.allocUnsafe(e),i=0,s=r(2*e),o=0;for(;i=0)throw new Error("data too long for modulus")}return n?l(p,h):u(p,h)}},{"./mgf":344,"./withPublic":348,"./xor":349,"bn.js":345,"browserify-rsa":94,"create-hash":145,"parse-asn1":332,randombytes:358,"safe-buffer":386}],348:[function(e,t,n){var i=e("bn.js"),r=e("safe-buffer").Buffer;t.exports=function(e,t){return r.from(e.toRed(i.mont(t.modulus)).redPow(new i(t.publicExponent)).fromRed().toArray())}},{"bn.js":345,"safe-buffer":386}],349:[function(e,t,n){t.exports=function(e,t){for(var n=e.length,i=-1;++i0,(function(t){e||(e=t),t&&i.forEach(l),o||(i.forEach(l),n(e))}))}));return t.reduce(d)}}).call(this)}).call(this,e("_process"))},{_process:342,"end-of-stream":194,fs:73,once:327}],351:[function(e,t,n){(function(e){(function(){!function(i){var r="object"==typeof n&&n&&!n.nodeType&&n,s="object"==typeof t&&t&&!t.nodeType&&t,o="object"==typeof e&&e;o.global!==o&&o.window!==o&&o.self!==o||(i=o);var a,c,u=2147483647,l=36,d=/^xn--/,f=/[^\x20-\x7E]/,p=/[\x2E\u3002\uFF0E\uFF61]/g,h={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},m=Math.floor,b=String.fromCharCode;function g(e){throw new RangeError(h[e])}function v(e,t){for(var n=e.length,i=[];n--;)i[n]=t(e[n]);return i}function y(e,t){var n=e.split("@"),i="";return n.length>1&&(i=n[0]+"@",e=n[1]),i+v((e=e.replace(p,".")).split("."),t).join(".")}function _(e){for(var t,n,i=[],r=0,s=e.length;r=55296&&t<=56319&&r65535&&(t+=b((e-=65536)>>>10&1023|55296),e=56320|1023&e),t+=b(e)})).join("")}function x(e,t){return e+22+75*(e<26)-((0!=t)<<5)}function k(e,t,n){var i=0;for(e=n?m(e/700):e>>1,e+=m(e/t);e>455;i+=l)e=m(e/35);return m(i+36*e/(e+38))}function E(e){var t,n,i,r,s,o,a,c,d,f,p,h=[],b=e.length,v=0,y=128,_=72;for((n=e.lastIndexOf("-"))<0&&(n=0),i=0;i=128&&g("not-basic"),h.push(e.charCodeAt(i));for(r=n>0?n+1:0;r=b&&g("invalid-input"),((c=(p=e.charCodeAt(r++))-48<10?p-22:p-65<26?p-65:p-97<26?p-97:l)>=l||c>m((u-v)/o))&&g("overflow"),v+=c*o,!(c<(d=a<=_?1:a>=_+26?26:a-_));a+=l)o>m(u/(f=l-d))&&g("overflow"),o*=f;_=k(v-s,t=h.length+1,0==s),m(v/t)>u-y&&g("overflow"),y+=m(v/t),v%=t,h.splice(v++,0,y)}return w(h)}function S(e){var t,n,i,r,s,o,a,c,d,f,p,h,v,y,w,E=[];for(h=(e=_(e)).length,t=128,n=0,s=72,o=0;o=t&&pm((u-n)/(v=i+1))&&g("overflow"),n+=(a-t)*v,t=a,o=0;ou&&g("overflow"),p==t){for(c=n,d=l;!(c<(f=d<=s?1:d>=s+26?26:d-s));d+=l)w=c-f,y=l-f,E.push(b(x(f+w%y,0))),c=m(w/y);E.push(b(x(c,0))),s=k(n,v,i==r),n=0,++i}++n,++t}return E.join("")}if(a={version:"1.4.1",ucs2:{decode:_,encode:w},decode:E,encode:S,toASCII:function(e){return y(e,(function(e){return f.test(e)?"xn--"+S(e):e}))},toUnicode:function(e){return y(e,(function(e){return d.test(e)?E(e.slice(4).toLowerCase()):e}))}},"function"==typeof define&&"object"==typeof define.amd&&define.amd)define("punycode",(function(){return a}));else if(r&&s)if(t.exports==r)s.exports=a;else for(c in a)a.hasOwnProperty(c)&&(r[c]=a[c]);else i.punycode=a}(this)}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],352:[function(e,t,n){"use strict";function i(e,t){return Object.prototype.hasOwnProperty.call(e,t)}t.exports=function(e,t,n,s){t=t||"&",n=n||"=";var o={};if("string"!=typeof e||0===e.length)return o;var a=/\+/g;e=e.split(t);var c=1e3;s&&"number"==typeof s.maxKeys&&(c=s.maxKeys);var u=e.length;c>0&&u>c&&(u=c);for(var l=0;l=0?(d=m.substr(0,b),f=m.substr(b+1)):(d=m,f=""),p=decodeURIComponent(d),h=decodeURIComponent(f),i(o,p)?r(o[p])?o[p].push(h):o[p]=[o[p],h]:o[p]=h}return o};var r=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)}},{}],353:[function(e,t,n){"use strict";var i=function(e){switch(typeof e){case"string":return e;case"boolean":return e?"true":"false";case"number":return isFinite(e)?e:"";default:return""}};t.exports=function(e,t,n,a){return t=t||"&",n=n||"=",null===e&&(e=void 0),"object"==typeof e?s(o(e),(function(o){var a=encodeURIComponent(i(o))+n;return r(e[o])?s(e[o],(function(e){return a+encodeURIComponent(i(e))})).join(t):a+encodeURIComponent(i(e[o]))})).join(t):a?encodeURIComponent(i(a))+n+encodeURIComponent(i(e)):""};var r=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)};function s(e,t){if(e.map)return e.map(t);for(var n=[],i=0;i{f("number"==typeof e.length,"info.files[0].length"),f(e["path.utf-8"]||e.path,"info.files[0].path")})):f("number"==typeof e.info.length,"info.length");const t={info:e.info,infoBuffer:n.encode(e.info),name:(e.info["name.utf-8"]||e.info.name).toString(),announce:[]};t.infoHash=l.sync(t.infoBuffer),t.infoHashBuffer=i.from(t.infoHash,"hex"),void 0!==e.info.private&&(t.private=!!e.info.private);e["creation date"]&&(t.created=new Date(1e3*e["creation date"]));e["created by"]&&(t.createdBy=e["created by"].toString());i.isBuffer(e.comment)&&(t.comment=e.comment.toString());Array.isArray(e["announce-list"])&&e["announce-list"].length>0?e["announce-list"].forEach((e=>{e.forEach((e=>{t.announce.push(e.toString())}))})):e.announce&&t.announce.push(e.announce.toString());i.isBuffer(e["url-list"])&&(e["url-list"]=e["url-list"].length>0?[e["url-list"]]:[]);t.urlList=(e["url-list"]||[]).map((e=>e.toString())),t.announce=Array.from(new Set(t.announce)),t.urlList=Array.from(new Set(t.urlList));const r=e.info.files||[e.info];t.files=r.map(((e,i)=>{const n=[].concat(t.name,e["path.utf-8"]||e.path||[]).map((e=>e.toString()));return{path:c.join.apply(null,[c.sep].concat(n)).slice(1),name:n[n.length-1],length:e.length,offset:r.slice(0,i).reduce(d,0)}})),t.length=r.reduce(d,0);const s=t.files[t.files.length-1];return t.pieceLength=e.info["piece length"],t.lastPieceLength=(s.offset+s.length)%t.pieceLength||t.pieceLength,t.pieces=function(e){const t=[];for(let i=0;i{n(null,o)})):(c=t,"undefined"!=typeof Blob&&c instanceof Blob?r(t,((e,t)=>{if(e)return n(new Error(`Error converting Blob: ${e.message}`));l(t)})):"function"==typeof a&&/^https?:/.test(t)?(i=Object.assign({url:t,timeout:3e4,headers:{"user-agent":"WebTorrent (https://webtorrent.io)"}},i),a.concat(i,((e,t,i)=>{if(e)return n(new Error(`Error downloading torrent: ${e.message}`));l(i)}))):"function"==typeof s.readFile&&"string"==typeof t?s.readFile(t,((e,t)=>{if(e)return n(new Error("Invalid torrent identifier"));l(t)})):u((()=>{n(new Error("Invalid torrent identifier"))})));var c;function l(e){try{o=p(e)}catch(e){return n(e)}o&&o.infoHash?n(null,o):n(new Error("Invalid torrent identifier"))}},t.exports.toMagnetURI=o.encode,t.exports.toTorrentFile=function(e){const t={info:e.info};t["announce-list"]=(e.announce||[]).map((e=>(t.announce||(t.announce=e),[e=i.from(e,"utf8")]))),t["url-list"]=e.urlList||[],void 0!==e.private&&(t.private=Number(e.private));e.created&&(t["creation date"]=e.created.getTime()/1e3|0);e.createdBy&&(t["created by"]=e.createdBy);e.comment&&(t.comment=e.comment);return n.encode(t)},i.alloc(0)}).call(this)}).call(this,e("buffer").Buffer)},{bencode:23,"blob-to-buffer":48,buffer:110,fs:67,"magnet-uri":257,path:333,"queue-microtask":354,"simple-get":394,"simple-sha1":411}],333:[function(e,t,i){(function(e){(function(){"use strict";function i(e){if("string"!=typeof e)throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}function n(e,t){for(var i,n="",r=0,s=-1,a=0,o=0;o<=e.length;++o){if(o2){var c=n.lastIndexOf("/");if(c!==n.length-1){-1===c?(n="",r=0):r=(n=n.slice(0,c)).length-1-n.lastIndexOf("/"),s=o,a=0;continue}}else if(2===n.length||1===n.length){n="",r=0,s=o,a=0;continue}t&&(n.length>0?n+="/..":n="..",r=2)}else n.length>0?n+="/"+e.slice(s+1,o):n=e.slice(s+1,o),r=o-s-1;s=o,a=0}else 46===i&&-1!==a?++a:a=-1}return n}var r={resolve:function(){for(var t,r="",s=!1,a=arguments.length-1;a>=-1&&!s;a--){var o;a>=0?o=arguments[a]:(void 0===t&&(t=e.cwd()),o=t),i(o),0!==o.length&&(r=o+"/"+r,s=47===o.charCodeAt(0))}return r=n(r,!s),s?r.length>0?"/"+r:"/":r.length>0?r:"."},normalize:function(e){if(i(e),0===e.length)return".";var t=47===e.charCodeAt(0),r=47===e.charCodeAt(e.length-1);return 0!==(e=n(e,!t)).length||t||(e="."),e.length>0&&r&&(e+="/"),t?"/"+e:e},isAbsolute:function(e){return i(e),e.length>0&&47===e.charCodeAt(0)},join:function(){if(0===arguments.length)return".";for(var e,t=0;t0&&(void 0===e?e=n:e+="/"+n)}return void 0===e?".":r.normalize(e)},relative:function(e,t){if(i(e),i(t),e===t)return"";if((e=r.resolve(e))===(t=r.resolve(t)))return"";for(var n=1;nl){if(47===t.charCodeAt(o+p))return t.slice(o+p+1);if(0===p)return t.slice(o+p)}else a>l&&(47===e.charCodeAt(n+p)?u=p:0===p&&(u=0));break}var d=e.charCodeAt(n+p);if(d!==t.charCodeAt(o+p))break;47===d&&(u=p)}var f="";for(p=n+u+1;p<=s;++p)p!==s&&47!==e.charCodeAt(p)||(0===f.length?f+="..":f+="/..");return f.length>0?f+t.slice(o+u):(o+=u,47===t.charCodeAt(o)&&++o,t.slice(o))},_makeLong:function(e){return e},dirname:function(e){if(i(e),0===e.length)return".";for(var t=e.charCodeAt(0),n=47===t,r=-1,s=!0,a=e.length-1;a>=1;--a)if(47===(t=e.charCodeAt(a))){if(!s){r=a;break}}else s=!1;return-1===r?n?"/":".":n&&1===r?"//":e.slice(0,r)},basename:function(e,t){if(void 0!==t&&"string"!=typeof t)throw new TypeError('"ext" argument must be a string');i(e);var n,r=0,s=-1,a=!0;if(void 0!==t&&t.length>0&&t.length<=e.length){if(t.length===e.length&&t===e)return"";var o=t.length-1,c=-1;for(n=e.length-1;n>=0;--n){var l=e.charCodeAt(n);if(47===l){if(!a){r=n+1;break}}else-1===c&&(a=!1,c=n+1),o>=0&&(l===t.charCodeAt(o)?-1==--o&&(s=n):(o=-1,s=c))}return r===s?s=c:-1===s&&(s=e.length),e.slice(r,s)}for(n=e.length-1;n>=0;--n)if(47===e.charCodeAt(n)){if(!a){r=n+1;break}}else-1===s&&(a=!1,s=n+1);return-1===s?"":e.slice(r,s)},extname:function(e){i(e);for(var t=-1,n=0,r=-1,s=!0,a=0,o=e.length-1;o>=0;--o){var c=e.charCodeAt(o);if(47!==c)-1===r&&(s=!1,r=o+1),46===c?-1===t?t=o:1!==a&&(a=1):-1!==t&&(a=-1);else if(!s){n=o+1;break}}return-1===t||-1===r||0===a||1===a&&t===r-1&&t===n+1?"":e.slice(t,r)},format:function(e){if(null===e||"object"!=typeof e)throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof e);return function(e,t){var i=t.dir||t.root,n=t.base||(t.name||"")+(t.ext||"");return i?i===t.root?i+n:i+e+n:n}("/",e)},parse:function(e){i(e);var t={root:"",dir:"",base:"",ext:"",name:""};if(0===e.length)return t;var n,r=e.charCodeAt(0),s=47===r;s?(t.root="/",n=1):n=0;for(var a=-1,o=0,c=-1,l=!0,u=e.length-1,p=0;u>=n;--u)if(47!==(r=e.charCodeAt(u)))-1===c&&(l=!1,c=u+1),46===r?-1===a?a=u:1!==p&&(p=1):-1!==a&&(p=-1);else if(!l){o=u+1;break}return-1===a||-1===c||0===p||1===p&&a===c-1&&a===o+1?-1!==c&&(t.base=t.name=0===o&&s?e.slice(1,c):e.slice(o,c)):(0===o&&s?(t.name=e.slice(1,a),t.base=e.slice(1,c)):(t.name=e.slice(o,a),t.base=e.slice(o,c)),t.ext=e.slice(a,c)),o>0?t.dir=e.slice(0,o-1):s&&(t.dir="/"),t},sep:"/",delimiter:":",win32:null,posix:null};r.posix=r,t.exports=r}).call(this)}).call(this,e("_process"))},{_process:341}],334:[function(e,t,i){i.pbkdf2=e("./lib/async"),i.pbkdf2Sync=e("./lib/sync")},{"./lib/async":335,"./lib/sync":338}],335:[function(e,t,i){(function(i){(function(){var n,r,s=e("safe-buffer").Buffer,a=e("./precondition"),o=e("./default-encoding"),c=e("./sync"),l=e("./to-buffer"),u=i.crypto&&i.crypto.subtle,p={sha:"SHA-1","sha-1":"SHA-1",sha1:"SHA-1",sha256:"SHA-256","sha-256":"SHA-256",sha384:"SHA-384","sha-384":"SHA-384","sha-512":"SHA-512",sha512:"SHA-512"},d=[];function f(){return r||(r=i.process&&i.process.nextTick?i.process.nextTick:i.queueMicrotask?i.queueMicrotask:i.setImmediate?i.setImmediate:i.setTimeout)}function h(e,t,i,n,r){return u.importKey("raw",e,{name:"PBKDF2"},!1,["deriveBits"]).then((function(e){return u.deriveBits({name:"PBKDF2",salt:t,iterations:i,hash:{name:r}},e,n<<3)})).then((function(e){return s.from(e)}))}t.exports=function(e,t,r,m,b,v){"function"==typeof b&&(v=b,b=void 0);var g=p[(b=b||"sha1").toLowerCase()];if(g&&"function"==typeof i.Promise){if(a(r,m),e=l(e,o,"Password"),t=l(t,o,"Salt"),"function"!=typeof v)throw new Error("No callback provided to pbkdf2");!function(e,t){e.then((function(e){f()((function(){t(null,e)}))}),(function(e){f()((function(){t(e)}))}))}(function(e){if(i.process&&!i.process.browser)return Promise.resolve(!1);if(!u||!u.importKey||!u.deriveBits)return Promise.resolve(!1);if(void 0!==d[e])return d[e];var t=h(n=n||s.alloc(8),n,10,128,e).then((function(){return!0})).catch((function(){return!1}));return d[e]=t,t}(g).then((function(i){return i?h(e,t,r,m,g):c(e,t,r,m,b)})),v)}else f()((function(){var i;try{i=c(e,t,r,m,b)}catch(e){return v(e)}v(null,i)}))}}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./default-encoding":336,"./precondition":337,"./sync":338,"./to-buffer":339,"safe-buffer":383}],336:[function(e,t,i){(function(e,i){(function(){var n;if(i.process&&i.process.browser)n="utf-8";else if(i.process&&i.process.version){n=parseInt(e.version.split(".")[0].slice(1),10)>=6?"utf-8":"binary"}else n="utf-8";t.exports=n}).call(this)}).call(this,e("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{_process:341}],337:[function(e,t,i){var n=Math.pow(2,30)-1;t.exports=function(e,t){if("number"!=typeof e)throw new TypeError("Iterations not a number");if(e<0)throw new TypeError("Bad iterations");if("number"!=typeof t)throw new TypeError("Key length not a number");if(t<0||t>n||t!=t)throw new TypeError("Bad key length")}},{}],338:[function(e,t,i){var n=e("create-hash/md5"),r=e("ripemd160"),s=e("sha.js"),a=e("safe-buffer").Buffer,o=e("./precondition"),c=e("./default-encoding"),l=e("./to-buffer"),u=a.alloc(128),p={md5:16,sha1:20,sha224:28,sha256:32,sha384:48,sha512:64,rmd160:20,ripemd160:20};function d(e,t,i){var o=function(e){function t(t){return s(e).update(t).digest()}function i(e){return(new r).update(e).digest()}return"rmd160"===e||"ripemd160"===e?i:"md5"===e?n:t}(e),c="sha512"===e||"sha384"===e?128:64;t.length>c?t=o(t):t.length1)for(var i=1;ih||new a(t).cmp(f.modulus)>=0)throw new Error("decryption error");d=i?l(new a(t),f):o(t,f);var m=u.alloc(h-d.length);if(d=u.concat([m,d],h),4===p)return function(e,t){var i=e.modulus.byteLength(),n=c("sha1").update(u.alloc(0)).digest(),a=n.length;if(0!==t[0])throw new Error("decryption error");var o=t.slice(1,a+1),l=t.slice(a+1),p=s(o,r(l,a)),d=s(l,r(p,i-a-1));if(function(e,t){e=u.from(e),t=u.from(t);var i=0,n=e.length;e.length!==t.length&&(i++,n=Math.min(e.length,t.length));var r=-1;for(;++r=t.length){s++;break}var a=t.slice(2,r-1);("0002"!==n.toString("hex")&&!i||"0001"!==n.toString("hex")&&i)&&s++;a.length<8&&s++;if(s)throw new Error("decryption error");return t.slice(r)}(0,d,i);if(3===p)return d;throw new Error("unknown padding")}},{"./mgf":343,"./withPublic":347,"./xor":348,"bn.js":344,"browserify-rsa":88,"create-hash":140,"parse-asn1":331,"safe-buffer":383}],346:[function(e,t,i){var n=e("parse-asn1"),r=e("randombytes"),s=e("create-hash"),a=e("./mgf"),o=e("./xor"),c=e("bn.js"),l=e("./withPublic"),u=e("browserify-rsa"),p=e("safe-buffer").Buffer;t.exports=function(e,t,i){var d;d=e.padding?e.padding:i?1:4;var f,h=n(e);if(4===d)f=function(e,t){var i=e.modulus.byteLength(),n=t.length,l=s("sha1").update(p.alloc(0)).digest(),u=l.length,d=2*u;if(n>i-d-2)throw new Error("message too long");var f=p.alloc(i-n-d-2),h=i-u-1,m=r(u),b=o(p.concat([l,f,p.alloc(1,1),t],h),a(m,h)),v=o(m,a(b,u));return new c(p.concat([p.alloc(1),v,b],i))}(h,t);else if(1===d)f=function(e,t,i){var n,s=t.length,a=e.modulus.byteLength();if(s>a-11)throw new Error("message too long");n=i?p.alloc(a-s-3,255):function(e){var t,i=p.allocUnsafe(e),n=0,s=r(2*e),a=0;for(;n=0)throw new Error("data too long for modulus")}return i?u(f,h):l(f,h)}},{"./mgf":343,"./withPublic":347,"./xor":348,"bn.js":344,"browserify-rsa":88,"create-hash":140,"parse-asn1":331,randombytes:357,"safe-buffer":383}],347:[function(e,t,i){var n=e("bn.js"),r=e("safe-buffer").Buffer;t.exports=function(e,t){return r.from(e.toRed(n.mont(t.modulus)).redPow(new n(t.publicExponent)).fromRed().toArray())}},{"bn.js":344,"safe-buffer":383}],348:[function(e,t,i){t.exports=function(e,t){for(var i=e.length,n=-1;++n0,(function(t){e||(e=t),t&&n.forEach(u),a||(n.forEach(u),i(e))}))}));return t.reduce(p)}}).call(this)}).call(this,e("_process"))},{_process:341,"end-of-stream":191,fs:67,once:326}],350:[function(e,t,i){(function(e){(function(){!function(n){var r="object"==typeof i&&i&&!i.nodeType&&i,s="object"==typeof t&&t&&!t.nodeType&&t,a="object"==typeof e&&e;a.global!==a&&a.window!==a&&a.self!==a||(n=a);var o,c,l=2147483647,u=36,p=/^xn--/,d=/[^\x20-\x7E]/,f=/[\x2E\u3002\uFF0E\uFF61]/g,h={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},m=Math.floor,b=String.fromCharCode;function v(e){throw new RangeError(h[e])}function g(e,t){for(var i=e.length,n=[];i--;)n[i]=t(e[i]);return n}function y(e,t){var i=e.split("@"),n="";return i.length>1&&(n=i[0]+"@",e=i[1]),n+g((e=e.replace(f,".")).split("."),t).join(".")}function _(e){for(var t,i,n=[],r=0,s=e.length;r=55296&&t<=56319&&r65535&&(t+=b((e-=65536)>>>10&1023|55296),e=56320|1023&e),t+=b(e)})).join("")}function w(e,t){return e+22+75*(e<26)-((0!=t)<<5)}function k(e,t,i){var n=0;for(e=i?m(e/700):e>>1,e+=m(e/t);e>455;n+=u)e=m(e/35);return m(n+36*e/(e+38))}function E(e){var t,i,n,r,s,a,o,c,p,d,f,h=[],b=e.length,g=0,y=128,_=72;for((i=e.lastIndexOf("-"))<0&&(i=0),n=0;n=128&&v("not-basic"),h.push(e.charCodeAt(n));for(r=i>0?i+1:0;r=b&&v("invalid-input"),((c=(f=e.charCodeAt(r++))-48<10?f-22:f-65<26?f-65:f-97<26?f-97:u)>=u||c>m((l-g)/a))&&v("overflow"),g+=c*a,!(c<(p=o<=_?1:o>=_+26?26:o-_));o+=u)a>m(l/(d=u-p))&&v("overflow"),a*=d;_=k(g-s,t=h.length+1,0==s),m(g/t)>l-y&&v("overflow"),y+=m(g/t),g%=t,h.splice(g++,0,y)}return x(h)}function S(e){var t,i,n,r,s,a,o,c,p,d,f,h,g,y,x,E=[];for(h=(e=_(e)).length,t=128,i=0,s=72,a=0;a=t&&fm((l-i)/(g=n+1))&&v("overflow"),i+=(o-t)*g,t=o,a=0;al&&v("overflow"),f==t){for(c=i,p=u;!(c<(d=p<=s?1:p>=s+26?26:p-s));p+=u)x=c-d,y=u-d,E.push(b(w(d+x%y,0))),c=m(x/y);E.push(b(w(c,0))),s=k(i,g,n==r),i=0,++n}++i,++t}return E.join("")}if(o={version:"1.4.1",ucs2:{decode:_,encode:x},decode:E,encode:S,toASCII:function(e){return y(e,(function(e){return d.test(e)?"xn--"+S(e):e}))},toUnicode:function(e){return y(e,(function(e){return p.test(e)?E(e.slice(4).toLowerCase()):e}))}},"function"==typeof define&&"object"==typeof define.amd&&define.amd)define("punycode",(function(){return o}));else if(r&&s)if(t.exports==r)s.exports=o;else for(c in o)o.hasOwnProperty(c)&&(r[c]=o[c]);else n.punycode=o}(this)}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],351:[function(e,t,i){"use strict";function n(e,t){return Object.prototype.hasOwnProperty.call(e,t)}t.exports=function(e,t,i,s){t=t||"&",i=i||"=";var a={};if("string"!=typeof e||0===e.length)return a;var o=/\+/g;e=e.split(t);var c=1e3;s&&"number"==typeof s.maxKeys&&(c=s.maxKeys);var l=e.length;c>0&&l>c&&(l=c);for(var u=0;u=0?(p=m.substr(0,b),d=m.substr(b+1)):(p=m,d=""),f=decodeURIComponent(p),h=decodeURIComponent(d),n(a,f)?r(a[f])?a[f].push(h):a[f]=[a[f],h]:a[f]=h}return a};var r=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)}},{}],352:[function(e,t,i){"use strict";var n=function(e){switch(typeof e){case"string":return e;case"boolean":return e?"true":"false";case"number":return isFinite(e)?e:"";default:return""}};t.exports=function(e,t,i,o){return t=t||"&",i=i||"=",null===e&&(e=void 0),"object"==typeof e?s(a(e),(function(a){var o=encodeURIComponent(n(a))+i;return r(e[a])?s(e[a],(function(e){return o+encodeURIComponent(n(e))})).join(t):o+encodeURIComponent(n(e[a]))})).join(t):o?encodeURIComponent(n(o))+i+encodeURIComponent(n(e)):""};var r=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)};function s(e,t){if(e.map)return e.map(t);for(var i=[],n=0;n */ -let n;t.exports="function"==typeof queueMicrotask?queueMicrotask.bind("undefined"!=typeof window?window:e):e=>(n||(n=Promise.resolve())).then(e).catch((e=>setTimeout((()=>{throw e}),0)))}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],356:[function(e,t,n){t.exports="function"==typeof queueMicrotask?queueMicrotask:e=>Promise.resolve().then(e)},{}],357:[function(e,t,n){t.exports=function(e){var t=0;return function(){if(t===e.length)return null;var n=e.length-t,i=Math.random()*n|0,r=e[t+i],s=e[t];return e[t]=r,e[t+i]=s,t++,r}}},{}],358:[function(e,t,n){(function(n,i){(function(){"use strict";var r=65536,s=4294967295;var o=e("safe-buffer").Buffer,a=i.crypto||i.msCrypto;a&&a.getRandomValues?t.exports=function(e,t){if(e>s)throw new RangeError("requested too many random bytes");var i=o.allocUnsafe(e);if(e>0)if(e>r)for(var c=0;cl||e<0)throw new TypeError("offset must be a uint32");if(e>c||e>t)throw new RangeError("offset out of range")}function f(e,t,n){if("number"!=typeof e||e!=e)throw new TypeError("size must be a number");if(e>l||e<0)throw new TypeError("size must be a uint32");if(e+t>n||e>c)throw new RangeError("buffer too small")}function p(e,n,i,r){if(t.browser){var s=e.buffer,a=new Uint8Array(s,n,i);return u.getRandomValues(a),r?void t.nextTick((function(){r(null,e)})):e}if(!r)return o(i).copy(e,n),e;o(i,(function(t,i){if(t)return r(t);i.copy(e,n),r(null,e)}))}u&&u.getRandomValues||!t.browser?(n.randomFill=function(e,t,n,r){if(!(a.isBuffer(e)||e instanceof i.Uint8Array))throw new TypeError('"buf" argument must be a Buffer or Uint8Array');if("function"==typeof t)r=t,t=0,n=e.length;else if("function"==typeof n)r=n,n=e.length-t;else if("function"!=typeof r)throw new TypeError('"cb" argument must be a function');return d(t,e.length),f(n,t,e.length),p(e,t,n,r)},n.randomFillSync=function(e,t,n){void 0===t&&(t=0);if(!(a.isBuffer(e)||e instanceof i.Uint8Array))throw new TypeError('"buf" argument must be a Buffer or Uint8Array');d(t,e.length),void 0===n&&(n=e.length-t);return f(n,t,e.length),p(e,t,n)}):(n.randomFill=r,n.randomFillSync=r)}).call(this)}).call(this,e("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{_process:342,randombytes:358,"safe-buffer":386}],360:[function(e,t,n){const{Writable:i,PassThrough:r}=e("readable-stream");t.exports=class extends i{constructor(e,t={}){super(t),this.destroyed=!1,this._queue=[],this._position=e||0,this._cb=null,this._buffer=null,this._out=null}_write(e,t,n){let i=!0;for(;;){if(this.destroyed)return;if(0===this._queue.length)return this._buffer=e,void(this._cb=n);this._buffer=null;var r=this._queue[0];const t=Math.max(r.start-this._position,0),s=r.end-this._position;if(t>=e.length)return this._position+=e.length,n(null);let o;if(s>e.length){this._position+=e.length,o=0===t?e:e.slice(t),i=r.stream.write(o)&&i;break}this._position+=s,o=0===t&&s===e.length?e:e.slice(t,s),i=r.stream.write(o)&&i,r.last&&r.stream.end(),e=e.slice(s),this._queue.shift()}i?n(null):r.stream.once("drain",n.bind(null,null))}slice(e){if(this.destroyed)return null;Array.isArray(e)||(e=[e]);const t=new r;return e.forEach(((n,i)=>{this._queue.push({start:n.start,end:n.end,stream:t,last:i===e.length-1})})),this._buffer&&this._write(this._buffer,null,this._cb),t}destroy(e){this.destroyed||(this.destroyed=!0,e&&this.emit("error",e))}}},{"readable-stream":375}],361:[function(e,t,n){arguments[4][32][0].apply(n,arguments)},{dup:32}],362:[function(e,t,n){arguments[4][33][0].apply(n,arguments)},{"./_stream_readable":364,"./_stream_writable":366,_process:342,dup:33,inherits:249}],363:[function(e,t,n){arguments[4][34][0].apply(n,arguments)},{"./_stream_transform":365,dup:34,inherits:249}],364:[function(e,t,n){arguments[4][35][0].apply(n,arguments)},{"../errors":361,"./_stream_duplex":362,"./internal/streams/async_iterator":367,"./internal/streams/buffer_list":368,"./internal/streams/destroy":369,"./internal/streams/from":371,"./internal/streams/state":373,"./internal/streams/stream":374,_process:342,buffer:116,dup:35,events:196,inherits:249,"string_decoder/":481,util:73}],365:[function(e,t,n){arguments[4][36][0].apply(n,arguments)},{"../errors":361,"./_stream_duplex":362,dup:36,inherits:249}],366:[function(e,t,n){arguments[4][37][0].apply(n,arguments)},{"../errors":361,"./_stream_duplex":362,"./internal/streams/destroy":369,"./internal/streams/state":373,"./internal/streams/stream":374,_process:342,buffer:116,dup:37,inherits:249,"util-deprecate":500}],367:[function(e,t,n){arguments[4][38][0].apply(n,arguments)},{"./end-of-stream":370,_process:342,dup:38}],368:[function(e,t,n){arguments[4][39][0].apply(n,arguments)},{buffer:116,dup:39,util:73}],369:[function(e,t,n){arguments[4][40][0].apply(n,arguments)},{_process:342,dup:40}],370:[function(e,t,n){arguments[4][41][0].apply(n,arguments)},{"../../../errors":361,dup:41}],371:[function(e,t,n){arguments[4][42][0].apply(n,arguments)},{dup:42}],372:[function(e,t,n){arguments[4][43][0].apply(n,arguments)},{"../../../errors":361,"./end-of-stream":370,dup:43}],373:[function(e,t,n){arguments[4][44][0].apply(n,arguments)},{"../../../errors":361,dup:44}],374:[function(e,t,n){arguments[4][45][0].apply(n,arguments)},{dup:45,events:196}],375:[function(e,t,n){arguments[4][46][0].apply(n,arguments)},{"./lib/_stream_duplex.js":362,"./lib/_stream_passthrough.js":363,"./lib/_stream_readable.js":364,"./lib/_stream_transform.js":365,"./lib/_stream_writable.js":366,"./lib/internal/streams/end-of-stream.js":370,"./lib/internal/streams/pipeline.js":372,dup:46}],376:[function(e,t,n){"use strict";function i(e){return parseInt(e,10)===e}function r(e){function t(t){if(void 0===t){t=new Array(e);for(var n=0;n(i||(i=Promise.resolve())).then(e).catch((e=>setTimeout((()=>{throw e}),0)))}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],355:[function(e,t,i){t.exports="function"==typeof queueMicrotask?queueMicrotask:e=>Promise.resolve().then(e)},{}],356:[function(e,t,i){t.exports=function(e){var t=0;return function(){if(t===e.length)return null;var i=e.length-t,n=Math.random()*i|0,r=e[t+n],s=e[t];return e[t]=r,e[t+n]=s,t++,r}}},{}],357:[function(e,t,i){(function(i,n){(function(){"use strict";var r=65536,s=4294967295;var a=e("safe-buffer").Buffer,o=n.crypto||n.msCrypto;o&&o.getRandomValues?t.exports=function(e,t){if(e>s)throw new RangeError("requested too many random bytes");var n=a.allocUnsafe(e);if(e>0)if(e>r)for(var c=0;cu||e<0)throw new TypeError("offset must be a uint32");if(e>c||e>t)throw new RangeError("offset out of range")}function d(e,t,i){if("number"!=typeof e||e!=e)throw new TypeError("size must be a number");if(e>u||e<0)throw new TypeError("size must be a uint32");if(e+t>i||e>c)throw new RangeError("buffer too small")}function f(e,i,n,r){if(t.browser){var s=e.buffer,o=new Uint8Array(s,i,n);return l.getRandomValues(o),r?void t.nextTick((function(){r(null,e)})):e}if(!r)return a(n).copy(e,i),e;a(n,(function(t,n){if(t)return r(t);n.copy(e,i),r(null,e)}))}l&&l.getRandomValues||!t.browser?(i.randomFill=function(e,t,i,r){if(!(o.isBuffer(e)||e instanceof n.Uint8Array))throw new TypeError('"buf" argument must be a Buffer or Uint8Array');if("function"==typeof t)r=t,t=0,i=e.length;else if("function"==typeof i)r=i,i=e.length-t;else if("function"!=typeof r)throw new TypeError('"cb" argument must be a function');return p(t,e.length),d(i,t,e.length),f(e,t,i,r)},i.randomFillSync=function(e,t,i){void 0===t&&(t=0);if(!(o.isBuffer(e)||e instanceof n.Uint8Array))throw new TypeError('"buf" argument must be a Buffer or Uint8Array');p(t,e.length),void 0===i&&(i=e.length-t);return d(i,t,e.length),f(e,t,i)}):(i.randomFill=r,i.randomFillSync=r)}).call(this)}).call(this,e("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{_process:341,randombytes:357,"safe-buffer":383}],359:[function(e,t,i){ +/*! + * range-parser + * Copyright(c) 2012-2014 TJ Holowaychuk + * Copyright(c) 2015-2016 Douglas Christopher Wilson + * MIT Licensed + */ +"use strict";function n(e,t){return{start:e.start,end:e.end,index:t}}function r(e){return{start:e.start,end:e.end}}function s(e,t){return e.index-t.index}function a(e,t){return e.start-t.start}t.exports=function(e,t,i){if("string"!=typeof t)throw new TypeError("argument str must be a string");var o=t.indexOf("=");if(-1===o)return-2;var c=t.slice(o+1).split(","),l=[];l.type=t.slice(0,o);for(var u=0;ue-1&&(f=e-1),isNaN(d)||isNaN(f)||d>f||d<0||l.push({start:d,end:f})}if(l.length<1)return-1;return i&&i.combine?function(e){for(var t=e.map(n).sort(a),i=0,o=1;ol.end+1?t[++i]=c:c.end>l.end&&(l.end=c.end,l.index=Math.min(l.index,c.index))}t.length=i+1;var u=t.sort(s).map(r);return u.type=e.type,u}(l):l}},{}],360:[function(e,t,i){const{Writable:n,PassThrough:r}=e("readable-stream");t.exports=class extends n{constructor(e,t={}){super(t),this.destroyed=!1,this._queue=[],this._position=e||0,this._cb=null,this._buffer=null,this._out=null}_write(e,t,i){let n=!0;for(;;){if(this.destroyed)return;if(0===this._queue.length)return this._buffer=e,void(this._cb=i);this._buffer=null;var r=this._queue[0];const t=Math.max(r.start-this._position,0),s=r.end-this._position;if(t>=e.length)return this._position+=e.length,i(null);let a;if(s>e.length){this._position+=e.length,a=0===t?e:e.slice(t),n=r.stream.write(a)&&n;break}this._position+=s,a=0===t&&s===e.length?e:e.slice(t,s),n=r.stream.write(a)&&n,r.last&&r.stream.end(),e=e.slice(s),this._queue.shift()}n?i(null):r.stream.once("drain",i.bind(null,null))}slice(e){if(this.destroyed)return null;Array.isArray(e)||(e=[e]);const t=new r;return e.forEach(((i,n)=>{this._queue.push({start:i.start,end:i.end,stream:t,last:n===e.length-1})})),this._buffer&&this._write(this._buffer,null,this._cb),t}destroy(e){this.destroyed||(this.destroyed=!0,e&&this.emit("error",e))}}},{"readable-stream":375}],361:[function(e,t,i){arguments[4][29][0].apply(i,arguments)},{dup:29}],362:[function(e,t,i){arguments[4][30][0].apply(i,arguments)},{"./_stream_readable":364,"./_stream_writable":366,_process:341,dup:30,inherits:246}],363:[function(e,t,i){arguments[4][31][0].apply(i,arguments)},{"./_stream_transform":365,dup:31,inherits:246}],364:[function(e,t,i){arguments[4][32][0].apply(i,arguments)},{"../errors":361,"./_stream_duplex":362,"./internal/streams/async_iterator":367,"./internal/streams/buffer_list":368,"./internal/streams/destroy":369,"./internal/streams/from":371,"./internal/streams/state":373,"./internal/streams/stream":374,_process:341,buffer:110,dup:32,events:193,inherits:246,"string_decoder/":472,util:67}],365:[function(e,t,i){arguments[4][33][0].apply(i,arguments)},{"../errors":361,"./_stream_duplex":362,dup:33,inherits:246}],366:[function(e,t,i){arguments[4][34][0].apply(i,arguments)},{"../errors":361,"./_stream_duplex":362,"./internal/streams/destroy":369,"./internal/streams/state":373,"./internal/streams/stream":374,_process:341,buffer:110,dup:34,inherits:246,"util-deprecate":485}],367:[function(e,t,i){arguments[4][35][0].apply(i,arguments)},{"./end-of-stream":370,_process:341,dup:35}],368:[function(e,t,i){arguments[4][36][0].apply(i,arguments)},{buffer:110,dup:36,util:67}],369:[function(e,t,i){arguments[4][37][0].apply(i,arguments)},{_process:341,dup:37}],370:[function(e,t,i){arguments[4][38][0].apply(i,arguments)},{"../../../errors":361,dup:38}],371:[function(e,t,i){arguments[4][39][0].apply(i,arguments)},{dup:39}],372:[function(e,t,i){arguments[4][40][0].apply(i,arguments)},{"../../../errors":361,"./end-of-stream":370,dup:40}],373:[function(e,t,i){arguments[4][41][0].apply(i,arguments)},{"../../../errors":361,dup:41}],374:[function(e,t,i){arguments[4][42][0].apply(i,arguments)},{dup:42,events:193}],375:[function(e,t,i){arguments[4][43][0].apply(i,arguments)},{"./lib/_stream_duplex.js":362,"./lib/_stream_passthrough.js":363,"./lib/_stream_readable.js":364,"./lib/_stream_transform.js":365,"./lib/_stream_writable.js":366,"./lib/internal/streams/end-of-stream.js":370,"./lib/internal/streams/pipeline.js":372,dup:43}],376:[function(e,t,i){"use strict";function n(e){return parseInt(e,10)===e}function r(e){function t(t){if(void 0===t){t=new Array(e);for(var i=0;i */ -n.render=function(e,t,n,i){"function"==typeof n&&(i=n,n={});n||(n={});i||(i=()=>{});y(e),_(n),"string"==typeof t&&(t=document.querySelector(t));g(e,(i=>{if(t.nodeName!==i.toUpperCase()){const n=o.extname(e.name).toLowerCase();throw new Error(`Cannot render "${n}" inside a "${t.nodeName.toLowerCase()}" element, expected "${i}"`)}return"video"!==i&&"audio"!==i||w(t,n),t}),n,i)},n.append=function(e,t,n,i){"function"==typeof n&&(i=n,n={});n||(n={});i||(i=()=>{});y(e),_(n),"string"==typeof t&&(t=document.querySelector(t));if(t&&("VIDEO"===t.nodeName||"AUDIO"===t.nodeName))throw new Error("Invalid video/audio node argument. Argument must be root element that video/audio tag will be appended to.");function r(e){const n=document.createElement(e);return t.appendChild(n),n}g(e,(function(e){return"video"===e||"audio"===e?function(e){const i=r(e);return w(i,n),t.appendChild(i),i}(e):r(e)}),n,(function(e,t){e&&t&&t.remove(),i(e,t)}))},n.mime=e("./lib/mime.json");const i=e("debug")("render-media"),r=e("is-ascii"),s=e("mediasource"),o=e("path"),a=e("stream-to-blob-url"),c=e("videostream"),u=[".m4a",".m4b",".m4p",".m4v",".mp4"],l=[".m4v",".mkv",".mp4",".webm"],d=[].concat(l,[".m4a",".m4b",".m4p",".mp3"]),f=[".mov",".ogv"],p=[".aac",".oga",".ogg",".wav",".flac"],h=[".bmp",".gif",".jpeg",".jpg",".png",".svg"],m=[".css",".html",".js",".md",".pdf",".srt",".txt"],b="undefined"!=typeof window&&window.MediaSource;function g(e,t,n,a){const g=o.extname(e.name).toLowerCase();let y,_=0;function w(){return!("number"==typeof e.length&&e.length>n.maxBlobLength)||(i("File length too large for Blob URL approach: %d (max: %d)",e.length,n.maxBlobLength),M(new Error(`File length too large for Blob URL approach: ${e.length} (max: ${n.maxBlobLength})`)),!1)}function x(n){w()&&(y=t(n),v(e,((e,t)=>{if(e)return M(e);y.addEventListener("error",M),y.addEventListener("loadstart",k),y.addEventListener("loadedmetadata",E),y.src=t})))}function k(){if(y.removeEventListener("loadstart",k),n.autoplay){const e=y.play();void 0!==e&&e.catch(M)}}function E(){y.removeEventListener("loadedmetadata",E),a(null,y)}function S(){v(e,((e,n)=>{if(e)return M(e);".pdf"!==g?(y=t("iframe"),y.sandbox="allow-forms allow-scripts",y.src=n):(y=t("object"),y.setAttribute("typemustmatch",!0),y.setAttribute("type","application/pdf"),y.setAttribute("data",n)),a(null,y)}))}function M(t){t.message=`Error rendering file "${e.name}": ${t.message}`,i(t.message),a(t)}d.includes(g)?function(){const n=l.includes(g)?"video":"audio";b?u.includes(g)?r():a():d();function r(){i(`Use \`videostream\` package for ${e.name}`),h(),y.addEventListener("error",f),y.addEventListener("loadstart",k),y.addEventListener("loadedmetadata",E),new c(e,y)}function a(){i(`Use MediaSource API for ${e.name}`),h(),y.addEventListener("error",p),y.addEventListener("loadstart",k),y.addEventListener("loadedmetadata",E);const t=new s(y).createWriteStream((n=e.name,{".m4a":'audio/mp4; codecs="mp4a.40.5"',".m4b":'audio/mp4; codecs="mp4a.40.5"',".m4p":'audio/mp4; codecs="mp4a.40.5"',".m4v":'video/mp4; codecs="avc1.640029, mp4a.40.5"',".mkv":'video/webm; codecs="avc1.640029, mp4a.40.5"',".mp3":"audio/mpeg",".mp4":'video/mp4; codecs="avc1.640029, mp4a.40.5"',".webm":'video/webm; codecs="vorbis, vp8"'}[o.extname(n).toLowerCase()]));var n;e.createReadStream().pipe(t),_&&(y.currentTime=_)}function d(){i(`Use Blob URL for ${e.name}`),h(),y.addEventListener("error",M),y.addEventListener("loadstart",k),y.addEventListener("loadedmetadata",E),v(e,((e,t)=>{if(e)return M(e);y.src=t,_&&(y.currentTime=_)}))}function f(e){i("videostream error: fallback to MediaSource API: %o",e.message||e),y.removeEventListener("error",f),y.removeEventListener("loadedmetadata",E),a()}function p(e){i("MediaSource API error: fallback to Blob URL: %o",e.message||e),w()&&(y.removeEventListener("error",p),y.removeEventListener("loadedmetadata",E),d())}function h(){y||(y=t(n),y.addEventListener("progress",(()=>{_=y.currentTime})))}}():f.includes(g)?x("video"):p.includes(g)?x("audio"):h.includes(g)?(y=t("img"),v(e,((t,n)=>{if(t)return M(t);y.src=n,y.alt=e.name,a(null,y)}))):m.includes(g)?S():function(){i('Unknown file extension "%s" - will attempt to render into iframe',g);let t="";function n(){r(t)?(i('File extension "%s" appears ascii, so will render.',g),S()):(i('File extension "%s" appears non-ascii, will not render.',g),a(new Error(`Unsupported file type "${g}": Cannot append to DOM`)))}e.createReadStream({start:0,end:1e3}).setEncoding("utf8").on("data",(e=>{t+=e})).on("end",n).on("error",a)}()}function v(e,t){const i=o.extname(e.name).toLowerCase();a(e.createReadStream(),n.mime[i]).then((e=>t(null,e)),(e=>t(e)))}function y(e){if(null==e)throw new Error("file cannot be null or undefined");if("string"!=typeof e.name)throw new Error("missing or invalid file.name property");if("function"!=typeof e.createReadStream)throw new Error("missing or invalid file.createReadStream property")}function _(e){null==e.autoplay&&(e.autoplay=!1),null==e.muted&&(e.muted=!1),null==e.controls&&(e.controls=!0),null==e.maxBlobLength&&(e.maxBlobLength=2e8)}function w(e,t){e.autoplay=!!t.autoplay,e.muted=!!t.muted,e.controls=!!t.controls}},{"./lib/mime.json":378,debug:379,"is-ascii":250,mediasource:265,path:334,"stream-to-blob-url":477,videostream:502}],378:[function(e,t,n){t.exports={".3gp":"video/3gpp",".aac":"audio/aac",".aif":"audio/x-aiff",".aiff":"audio/x-aiff",".atom":"application/atom+xml",".avi":"video/x-msvideo",".bmp":"image/bmp",".bz2":"application/x-bzip2",".conf":"text/plain",".css":"text/css",".csv":"text/plain",".diff":"text/x-diff",".doc":"application/msword",".flv":"video/x-flv",".gif":"image/gif",".gz":"application/x-gzip",".htm":"text/html",".html":"text/html",".ico":"image/vnd.microsoft.icon",".ics":"text/calendar",".iso":"application/octet-stream",".jar":"application/java-archive",".jpeg":"image/jpeg",".jpg":"image/jpeg",".js":"application/javascript",".json":"application/json",".less":"text/css",".log":"text/plain",".m3u":"audio/x-mpegurl",".m4a":"audio/x-m4a",".m4b":"audio/mp4",".m4p":"audio/mp4",".m4v":"video/x-m4v",".manifest":"text/cache-manifest",".markdown":"text/x-markdown",".mathml":"application/mathml+xml",".md":"text/x-markdown",".mid":"audio/midi",".midi":"audio/midi",".mov":"video/quicktime",".mp3":"audio/mpeg",".mp4":"video/mp4",".mp4v":"video/mp4",".mpeg":"video/mpeg",".mpg":"video/mpeg",".odp":"application/vnd.oasis.opendocument.presentation",".ods":"application/vnd.oasis.opendocument.spreadsheet",".odt":"application/vnd.oasis.opendocument.text",".oga":"audio/ogg",".ogg":"application/ogg",".pdf":"application/pdf",".png":"image/png",".pps":"application/vnd.ms-powerpoint",".ppt":"application/vnd.ms-powerpoint",".ps":"application/postscript",".psd":"image/vnd.adobe.photoshop",".qt":"video/quicktime",".rar":"application/x-rar-compressed",".rdf":"application/rdf+xml",".rss":"application/rss+xml",".rtf":"application/rtf",".svg":"image/svg+xml",".svgz":"image/svg+xml",".swf":"application/x-shockwave-flash",".tar":"application/x-tar",".tbz":"application/x-bzip-compressed-tar",".text":"text/plain",".tif":"image/tiff",".tiff":"image/tiff",".torrent":"application/x-bittorrent",".ttf":"application/x-font-ttf",".txt":"text/plain",".wav":"audio/wav",".webm":"video/webm",".wma":"audio/x-ms-wma",".wmv":"video/x-ms-wmv",".xls":"application/vnd.ms-excel",".xml":"application/xml",".yaml":"text/yaml",".yml":"text/yaml",".zip":"application/zip"}},{}],379:[function(e,t,n){arguments[4][29][0].apply(n,arguments)},{"./common":380,_process:342,dup:29}],380:[function(e,t,n){arguments[4][30][0].apply(n,arguments)},{dup:30,ms:381}],381:[function(e,t,n){arguments[4][31][0].apply(n,arguments)},{dup:31}],382:[function(e,t,n){"use strict";var i=e("buffer").Buffer,r=e("inherits"),s=e("hash-base"),o=new Array(16),a=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],c=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],u=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],l=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11],d=[0,1518500249,1859775393,2400959708,2840853838],f=[1352829926,1548603684,1836072691,2053994217,0];function p(){s.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520}function h(e,t){return e<>>32-t}function m(e,t,n,i,r,s,o,a){return h(e+(t^n^i)+s+o|0,a)+r|0}function b(e,t,n,i,r,s,o,a){return h(e+(t&n|~t&i)+s+o|0,a)+r|0}function g(e,t,n,i,r,s,o,a){return h(e+((t|~n)^i)+s+o|0,a)+r|0}function v(e,t,n,i,r,s,o,a){return h(e+(t&i|n&~i)+s+o|0,a)+r|0}function y(e,t,n,i,r,s,o,a){return h(e+(t^(n|~i))+s+o|0,a)+r|0}r(p,s),p.prototype._update=function(){for(var e=o,t=0;t<16;++t)e[t]=this._block.readInt32LE(4*t);for(var n=0|this._a,i=0|this._b,r=0|this._c,s=0|this._d,p=0|this._e,_=0|this._a,w=0|this._b,x=0|this._c,k=0|this._d,E=0|this._e,S=0;S<80;S+=1){var M,A;S<16?(M=m(n,i,r,s,p,e[a[S]],d[0],u[S]),A=y(_,w,x,k,E,e[c[S]],f[0],l[S])):S<32?(M=b(n,i,r,s,p,e[a[S]],d[1],u[S]),A=v(_,w,x,k,E,e[c[S]],f[1],l[S])):S<48?(M=g(n,i,r,s,p,e[a[S]],d[2],u[S]),A=g(_,w,x,k,E,e[c[S]],f[2],l[S])):S<64?(M=v(n,i,r,s,p,e[a[S]],d[3],u[S]),A=b(_,w,x,k,E,e[c[S]],f[3],l[S])):(M=y(n,i,r,s,p,e[a[S]],d[4],u[S]),A=m(_,w,x,k,E,e[c[S]],f[4],l[S])),n=p,p=s,s=h(r,10),r=i,i=M,_=E,E=k,k=h(x,10),x=w,w=A}var I=this._b+r+k|0;this._b=this._c+s+E|0,this._c=this._d+p+_|0,this._d=this._e+n+w|0,this._e=this._a+i+x|0,this._a=I},p.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var e=i.alloc?i.alloc(20):new i(20);return e.writeInt32LE(this._a,0),e.writeInt32LE(this._b,4),e.writeInt32LE(this._c,8),e.writeInt32LE(this._d,12),e.writeInt32LE(this._e,16),e},t.exports=p},{buffer:116,"hash-base":217,inherits:249}],383:[function(e,t,n){ +i.render=function(e,t,i,n){"function"==typeof i&&(n=i,i={});i||(i={});n||(n=()=>{});y(e),_(i),"string"==typeof t&&(t=document.querySelector(t));v(e,(n=>{if(t.nodeName!==n.toUpperCase()){const i=a.extname(e.name).toLowerCase();throw new Error(`Cannot render "${i}" inside a "${t.nodeName.toLowerCase()}" element, expected "${n}"`)}return"video"!==n&&"audio"!==n||x(t,i),t}),i,n)},i.append=function(e,t,i,n){"function"==typeof i&&(n=i,i={});i||(i={});n||(n=()=>{});y(e),_(i),"string"==typeof t&&(t=document.querySelector(t));if(t&&("VIDEO"===t.nodeName||"AUDIO"===t.nodeName))throw new Error("Invalid video/audio node argument. Argument must be root element that video/audio tag will be appended to.");function r(e){const i=document.createElement(e);return t.appendChild(i),i}v(e,(function(e){return"video"===e||"audio"===e?function(e){const n=r(e);return x(n,i),t.appendChild(n),n}(e):r(e)}),i,(function(e,t){e&&t&&t.remove(),n(e,t)}))},i.mime=e("./lib/mime.json");const n=e("debug")("render-media"),r=e("is-ascii"),s=e("mediasource"),a=e("path"),o=e("stream-to-blob-url"),c=e("videostream"),l=[".m4a",".m4b",".m4p",".m4v",".mp4"],u=[".m4v",".mkv",".mp4",".webm"],p=[].concat(u,[".m4a",".m4b",".m4p",".mp3"]),d=[".mov",".ogv"],f=[".aac",".oga",".ogg",".wav",".flac"],h=[".bmp",".gif",".jpeg",".jpg",".png",".svg"],m=[".css",".html",".js",".md",".pdf",".srt",".txt"],b="undefined"!=typeof window&&window.MediaSource;function v(e,t,i,o){const v=a.extname(e.name).toLowerCase();let y,_=0;function x(){return!("number"==typeof e.length&&e.length>i.maxBlobLength)||(n("File length too large for Blob URL approach: %d (max: %d)",e.length,i.maxBlobLength),M(new Error(`File length too large for Blob URL approach: ${e.length} (max: ${i.maxBlobLength})`)),!1)}function w(i){x()&&(y=t(i),g(e,((e,t)=>{if(e)return M(e);y.addEventListener("error",M),y.addEventListener("loadstart",k),y.addEventListener("loadedmetadata",E),y.src=t})))}function k(){if(y.removeEventListener("loadstart",k),i.autoplay){const e=y.play();void 0!==e&&e.catch(M)}}function E(){y.removeEventListener("loadedmetadata",E),o(null,y)}function S(){g(e,((e,i)=>{if(e)return M(e);".pdf"!==v?(y=t("iframe"),y.sandbox="allow-forms allow-scripts",y.src=i):(y=t("object"),y.setAttribute("typemustmatch",!0),y.setAttribute("type","application/pdf"),y.setAttribute("data",i)),o(null,y)}))}function M(t){t.message=`Error rendering file "${e.name}": ${t.message}`,n(t.message),o(t)}p.includes(v)?function(){const i=u.includes(v)?"video":"audio";b?l.includes(v)?r():o():p();function r(){n(`Use \`videostream\` package for ${e.name}`),h(),y.addEventListener("error",d),y.addEventListener("loadstart",k),y.addEventListener("loadedmetadata",E),new c(e,y)}function o(){n(`Use MediaSource API for ${e.name}`),h(),y.addEventListener("error",f),y.addEventListener("loadstart",k),y.addEventListener("loadedmetadata",E);const t=new s(y).createWriteStream((i=e.name,{".m4a":'audio/mp4; codecs="mp4a.40.5"',".m4b":'audio/mp4; codecs="mp4a.40.5"',".m4p":'audio/mp4; codecs="mp4a.40.5"',".m4v":'video/mp4; codecs="avc1.640029, mp4a.40.5"',".mkv":'video/webm; codecs="avc1.640029, mp4a.40.5"',".mp3":"audio/mpeg",".mp4":'video/mp4; codecs="avc1.640029, mp4a.40.5"',".webm":'video/webm; codecs="vorbis, vp8"'}[a.extname(i).toLowerCase()]));var i;e.createReadStream().pipe(t),_&&(y.currentTime=_)}function p(){n(`Use Blob URL for ${e.name}`),h(),y.addEventListener("error",M),y.addEventListener("loadstart",k),y.addEventListener("loadedmetadata",E),g(e,((e,t)=>{if(e)return M(e);y.src=t,_&&(y.currentTime=_)}))}function d(e){n("videostream error: fallback to MediaSource API: %o",e.message||e),y.removeEventListener("error",d),y.removeEventListener("loadedmetadata",E),o()}function f(e){n("MediaSource API error: fallback to Blob URL: %o",e.message||e),x()&&(y.removeEventListener("error",f),y.removeEventListener("loadedmetadata",E),p())}function h(){y||(y=t(i),y.addEventListener("progress",(()=>{_=y.currentTime})))}}():d.includes(v)?w("video"):f.includes(v)?w("audio"):h.includes(v)?(y=t("img"),g(e,((t,i)=>{if(t)return M(t);y.src=i,y.alt=e.name,o(null,y)}))):m.includes(v)?S():function(){n('Unknown file extension "%s" - will attempt to render into iframe',v);let t="";function i(){r(t)?(n('File extension "%s" appears ascii, so will render.',v),S()):(n('File extension "%s" appears non-ascii, will not render.',v),o(new Error(`Unsupported file type "${v}": Cannot append to DOM`)))}e.createReadStream({start:0,end:1e3}).setEncoding("utf8").on("data",(e=>{t+=e})).on("end",i).on("error",o)}()}function g(e,t){const n=a.extname(e.name).toLowerCase();o(e.createReadStream(),i.mime[n]).then((e=>t(null,e)),(e=>t(e)))}function y(e){if(null==e)throw new Error("file cannot be null or undefined");if("string"!=typeof e.name)throw new Error("missing or invalid file.name property");if("function"!=typeof e.createReadStream)throw new Error("missing or invalid file.createReadStream property")}function _(e){null==e.autoplay&&(e.autoplay=!1),null==e.muted&&(e.muted=!1),null==e.controls&&(e.controls=!0),null==e.maxBlobLength&&(e.maxBlobLength=2e8)}function x(e,t){e.autoplay=!!t.autoplay,e.muted=!!t.muted,e.controls=!!t.controls}},{"./lib/mime.json":378,debug:161,"is-ascii":247,mediasource:259,path:333,"stream-to-blob-url":468,videostream:487}],378:[function(e,t,i){t.exports={".3gp":"video/3gpp",".aac":"audio/aac",".aif":"audio/x-aiff",".aiff":"audio/x-aiff",".atom":"application/atom+xml",".avi":"video/x-msvideo",".bmp":"image/bmp",".bz2":"application/x-bzip2",".conf":"text/plain",".css":"text/css",".csv":"text/plain",".diff":"text/x-diff",".doc":"application/msword",".flv":"video/x-flv",".gif":"image/gif",".gz":"application/x-gzip",".htm":"text/html",".html":"text/html",".ico":"image/vnd.microsoft.icon",".ics":"text/calendar",".iso":"application/octet-stream",".jar":"application/java-archive",".jpeg":"image/jpeg",".jpg":"image/jpeg",".js":"application/javascript",".json":"application/json",".less":"text/css",".log":"text/plain",".m3u":"audio/x-mpegurl",".m4a":"audio/x-m4a",".m4b":"audio/mp4",".m4p":"audio/mp4",".m4v":"video/x-m4v",".manifest":"text/cache-manifest",".markdown":"text/x-markdown",".mathml":"application/mathml+xml",".md":"text/x-markdown",".mid":"audio/midi",".midi":"audio/midi",".mov":"video/quicktime",".mp3":"audio/mpeg",".mp4":"video/mp4",".mp4v":"video/mp4",".mpeg":"video/mpeg",".mpg":"video/mpeg",".odp":"application/vnd.oasis.opendocument.presentation",".ods":"application/vnd.oasis.opendocument.spreadsheet",".odt":"application/vnd.oasis.opendocument.text",".oga":"audio/ogg",".ogg":"application/ogg",".pdf":"application/pdf",".png":"image/png",".pps":"application/vnd.ms-powerpoint",".ppt":"application/vnd.ms-powerpoint",".ps":"application/postscript",".psd":"image/vnd.adobe.photoshop",".qt":"video/quicktime",".rar":"application/x-rar-compressed",".rdf":"application/rdf+xml",".rss":"application/rss+xml",".rtf":"application/rtf",".svg":"image/svg+xml",".svgz":"image/svg+xml",".swf":"application/x-shockwave-flash",".tar":"application/x-tar",".tbz":"application/x-bzip-compressed-tar",".text":"text/plain",".tif":"image/tiff",".tiff":"image/tiff",".torrent":"application/x-bittorrent",".ttf":"application/x-font-ttf",".txt":"text/plain",".wav":"audio/wav",".webm":"video/webm",".wma":"audio/x-ms-wma",".wmv":"video/x-ms-wmv",".xls":"application/vnd.ms-excel",".xml":"application/xml",".yaml":"text/yaml",".yml":"text/yaml",".zip":"application/zip"}},{}],379:[function(e,t,i){"use strict";var n=e("buffer").Buffer,r=e("inherits"),s=e("hash-base"),a=new Array(16),o=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],c=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],l=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],u=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11],p=[0,1518500249,1859775393,2400959708,2840853838],d=[1352829926,1548603684,1836072691,2053994217,0];function f(){s.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520}function h(e,t){return e<>>32-t}function m(e,t,i,n,r,s,a,o){return h(e+(t^i^n)+s+a|0,o)+r|0}function b(e,t,i,n,r,s,a,o){return h(e+(t&i|~t&n)+s+a|0,o)+r|0}function v(e,t,i,n,r,s,a,o){return h(e+((t|~i)^n)+s+a|0,o)+r|0}function g(e,t,i,n,r,s,a,o){return h(e+(t&n|i&~n)+s+a|0,o)+r|0}function y(e,t,i,n,r,s,a,o){return h(e+(t^(i|~n))+s+a|0,o)+r|0}r(f,s),f.prototype._update=function(){for(var e=a,t=0;t<16;++t)e[t]=this._block.readInt32LE(4*t);for(var i=0|this._a,n=0|this._b,r=0|this._c,s=0|this._d,f=0|this._e,_=0|this._a,x=0|this._b,w=0|this._c,k=0|this._d,E=0|this._e,S=0;S<80;S+=1){var M,A;S<16?(M=m(i,n,r,s,f,e[o[S]],p[0],l[S]),A=y(_,x,w,k,E,e[c[S]],d[0],u[S])):S<32?(M=b(i,n,r,s,f,e[o[S]],p[1],l[S]),A=g(_,x,w,k,E,e[c[S]],d[1],u[S])):S<48?(M=v(i,n,r,s,f,e[o[S]],p[2],l[S]),A=v(_,x,w,k,E,e[c[S]],d[2],u[S])):S<64?(M=g(i,n,r,s,f,e[o[S]],p[3],l[S]),A=b(_,x,w,k,E,e[c[S]],d[3],u[S])):(M=y(i,n,r,s,f,e[o[S]],p[4],l[S]),A=m(_,x,w,k,E,e[c[S]],d[4],u[S])),i=f,f=s,s=h(r,10),r=n,n=M,_=E,E=k,k=h(w,10),w=x,x=A}var j=this._b+r+k|0;this._b=this._c+s+E|0,this._c=this._d+f+_|0,this._d=this._e+i+x|0,this._e=this._a+n+w|0,this._a=j},f.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var e=n.alloc?n.alloc(20):new n(20);return e.writeInt32LE(this._a,0),e.writeInt32LE(this._b,4),e.writeInt32LE(this._c,8),e.writeInt32LE(this._d,12),e.writeInt32LE(this._e,16),e},t.exports=f},{buffer:110,"hash-base":214,inherits:246}],380:[function(e,t,i){ /*! run-parallel-limit. MIT License. Feross Aboukhadijeh */ -t.exports=function(e,t,n){if("number"!=typeof t)throw new Error("second argument must be a Number");let r,s,o,a,c,u,l=!0;Array.isArray(e)?(r=[],o=s=e.length):(a=Object.keys(e),r={},o=s=a.length);function d(e){function t(){n&&n(e,r),n=null}l?i(t):t()}function f(t,n,i){if(r[t]=i,n&&(c=!0),0==--o||n)d(n);else if(!c&&u */ -t.exports=function(e,t){let n,r,s,o=!0;Array.isArray(e)?(n=[],r=e.length):(s=Object.keys(e),n={},r=s.length);function a(e){function r(){t&&t(e,n),t=null}o?i(r):r()}function c(e,t,i){n[e]=i,(0==--r||t)&&a(t)}r?s?s.forEach((function(t){e[t]((function(e,n){c(t,e,n)}))})):e.forEach((function(e,t){e((function(e,n){c(t,e,n)}))})):a(null);o=!1};const i=e("queue-microtask")},{"queue-microtask":355}],385:[function(e,t,n){var i,r;i="undefined"!=typeof self?self:this,r=function(){return function(e){var t={};function n(i){if(t[i])return t[i].exports;var r=t[i]={i:i,l:!1,exports:{}};return e[i].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=e,n.c=t,n.d=function(e,t,i){n.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:i})},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=3)}([function(e,t,n){var i=n(5),r=n(1),s=r.toHex,o=r.ceilHeapSize,a=n(6),c=function(e){for(e+=9;e%64>0;e+=1);return e},u=function(e,t){var n=new Int32Array(e,t+320,5),i=new Int32Array(5),r=new DataView(i.buffer);return r.setInt32(0,n[0],!1),r.setInt32(4,n[1],!1),r.setInt32(8,n[2],!1),r.setInt32(12,n[3],!1),r.setInt32(16,n[4],!1),i},l=function(){function e(t){if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),(t=t||65536)%64>0)throw new Error("Chunk size must be a multiple of 128 bit");this._offset=0,this._maxChunkLen=t,this._padMaxChunkLen=c(t),this._heap=new ArrayBuffer(o(this._padMaxChunkLen+320+20)),this._h32=new Int32Array(this._heap),this._h8=new Int8Array(this._heap),this._core=new i({Int32Array:Int32Array},{},this._heap)}return e.prototype._initState=function(e,t){this._offset=0;var n=new Int32Array(e,t+320,5);n[0]=1732584193,n[1]=-271733879,n[2]=-1732584194,n[3]=271733878,n[4]=-1009589776},e.prototype._padChunk=function(e,t){var n=c(e),i=new Int32Array(this._heap,0,n>>2);return function(e,t){var n=new Uint8Array(e.buffer),i=t%4,r=t-i;switch(i){case 0:n[r+3]=0;case 1:n[r+2]=0;case 2:n[r+1]=0;case 3:n[r+0]=0}for(var s=1+(t>>2);s>2]|=128<<24-(t%4<<3),e[14+(2+(t>>2)&-16)]=n/(1<<29)|0,e[15+(2+(t>>2)&-16)]=n<<3}(i,e,t),n},e.prototype._write=function(e,t,n,i){a(e,this._h8,this._h32,t,n,i||0)},e.prototype._coreCall=function(e,t,n,i,r){var s=n;this._write(e,t,n),r&&(s=this._padChunk(n,i)),this._core.hash(s,this._padMaxChunkLen)},e.prototype.rawDigest=function(e){var t=e.byteLength||e.length||e.size||0;this._initState(this._heap,this._padMaxChunkLen);var n=0,i=this._maxChunkLen;for(n=0;t>n+i;n+=i)this._coreCall(e,n,i,t,!1);return this._coreCall(e,n,t-n,t,!0),u(this._heap,this._padMaxChunkLen)},e.prototype.digest=function(e){return s(this.rawDigest(e).buffer)},e.prototype.digestFromString=function(e){return this.digest(e)},e.prototype.digestFromBuffer=function(e){return this.digest(e)},e.prototype.digestFromArrayBuffer=function(e){return this.digest(e)},e.prototype.resetState=function(){return this._initState(this._heap,this._padMaxChunkLen),this},e.prototype.append=function(e){var t=0,n=e.byteLength||e.length||e.size||0,i=this._offset%this._maxChunkLen,r=void 0;for(this._offset+=n;t0}),!1)}e.exports=function(e,t){t=t||{};var r={main:n.m},s=t.all?{main:Object.keys(r)}:function(e,t){for(var n={main:[t]},i={main:[]},r={main:{}};c(n);)for(var s=Object.keys(n),o=0;o>2]|0;a=i[t+324>>2]|0;u=i[t+328>>2]|0;d=i[t+332>>2]|0;p=i[t+336>>2]|0;for(n=0;(n|0)<(e|0);n=n+64|0){o=s;c=a;l=u;f=d;h=p;for(r=0;(r|0)<64;r=r+4|0){b=i[n+r>>2]|0;m=((s<<5|s>>>27)+(a&u|~a&d)|0)+((b+p|0)+1518500249|0)|0;p=d;d=u;u=a<<30|a>>>2;a=s;s=m;i[e+r>>2]=b}for(r=e+64|0;(r|0)<(e+80|0);r=r+4|0){b=(i[r-12>>2]^i[r-32>>2]^i[r-56>>2]^i[r-64>>2])<<1|(i[r-12>>2]^i[r-32>>2]^i[r-56>>2]^i[r-64>>2])>>>31;m=((s<<5|s>>>27)+(a&u|~a&d)|0)+((b+p|0)+1518500249|0)|0;p=d;d=u;u=a<<30|a>>>2;a=s;s=m;i[r>>2]=b}for(r=e+80|0;(r|0)<(e+160|0);r=r+4|0){b=(i[r-12>>2]^i[r-32>>2]^i[r-56>>2]^i[r-64>>2])<<1|(i[r-12>>2]^i[r-32>>2]^i[r-56>>2]^i[r-64>>2])>>>31;m=((s<<5|s>>>27)+(a^u^d)|0)+((b+p|0)+1859775393|0)|0;p=d;d=u;u=a<<30|a>>>2;a=s;s=m;i[r>>2]=b}for(r=e+160|0;(r|0)<(e+240|0);r=r+4|0){b=(i[r-12>>2]^i[r-32>>2]^i[r-56>>2]^i[r-64>>2])<<1|(i[r-12>>2]^i[r-32>>2]^i[r-56>>2]^i[r-64>>2])>>>31;m=((s<<5|s>>>27)+(a&u|a&d|u&d)|0)+((b+p|0)-1894007588|0)|0;p=d;d=u;u=a<<30|a>>>2;a=s;s=m;i[r>>2]=b}for(r=e+240|0;(r|0)<(e+320|0);r=r+4|0){b=(i[r-12>>2]^i[r-32>>2]^i[r-56>>2]^i[r-64>>2])<<1|(i[r-12>>2]^i[r-32>>2]^i[r-56>>2]^i[r-64>>2])>>>31;m=((s<<5|s>>>27)+(a^u^d)|0)+((b+p|0)-899497514|0)|0;p=d;d=u;u=a<<30|a>>>2;a=s;s=m;i[r>>2]=b}s=s+o|0;a=a+c|0;u=u+l|0;d=d+f|0;p=p+h|0}i[t+320>>2]=s;i[t+324>>2]=a;i[t+328>>2]=u;i[t+332>>2]=d;i[t+336>>2]=p}return{hash:r}}},function(e,t){var n=this,i=void 0;"undefined"!=typeof self&&void 0!==self.FileReaderSync&&(i=new self.FileReaderSync);var r=function(e,t,n,i,r,s){var o=void 0,a=s%4,c=(r+a)%4,u=r-c;switch(a){case 0:t[s]=e[i+3];case 1:t[s+1-(a<<1)|0]=e[i+2];case 2:t[s+2-(a<<1)|0]=e[i+1];case 3:t[s+3-(a<<1)|0]=e[i]}if(!(r>2|0]=e[i+o]<<24|e[i+o+1]<<16|e[i+o+2]<<8|e[i+o+3];switch(c){case 3:t[s+u+1|0]=e[i+u+2];case 2:t[s+u+2|0]=e[i+u+1];case 1:t[s+u+3|0]=e[i+u]}}};e.exports=function(e,t,s,o,a,c){if("string"==typeof e)return function(e,t,n,i,r,s){var o=void 0,a=s%4,c=(r+a)%4,u=r-c;switch(a){case 0:t[s]=e.charCodeAt(i+3);case 1:t[s+1-(a<<1)|0]=e.charCodeAt(i+2);case 2:t[s+2-(a<<1)|0]=e.charCodeAt(i+1);case 3:t[s+3-(a<<1)|0]=e.charCodeAt(i)}if(!(r>2]=e.charCodeAt(i+o)<<24|e.charCodeAt(i+o+1)<<16|e.charCodeAt(i+o+2)<<8|e.charCodeAt(i+o+3);switch(c){case 3:t[s+u+1|0]=e.charCodeAt(i+u+2);case 2:t[s+u+2|0]=e.charCodeAt(i+u+1);case 1:t[s+u+3|0]=e.charCodeAt(i+u)}}}(e,t,s,o,a,c);if(e instanceof Array)return r(e,t,s,o,a,c);if(n&&n.Buffer&&n.Buffer.isBuffer(e))return r(e,t,s,o,a,c);if(e instanceof ArrayBuffer)return r(new Uint8Array(e),t,s,o,a,c);if(e.buffer instanceof ArrayBuffer)return r(new Uint8Array(e.buffer,e.byteOffset,e.byteLength),t,s,o,a,c);if(e instanceof Blob)return function(e,t,n,r,s,o){var a=void 0,c=o%4,u=(s+c)%4,l=s-u,d=new Uint8Array(i.readAsArrayBuffer(e.slice(r,r+s)));switch(c){case 0:t[o]=d[3];case 1:t[o+1-(c<<1)|0]=d[2];case 2:t[o+2-(c<<1)|0]=d[1];case 3:t[o+3-(c<<1)|0]=d[0]}if(!(s>2|0]=d[a]<<24|d[a+1]<<16|d[a+2]<<8|d[a+3];switch(u){case 3:t[o+l+1|0]=d[l+2];case 2:t[o+l+2|0]=d[l+1];case 1:t[o+l+3|0]=d[l]}}}(e,t,s,o,a,c);throw new Error("Unsupported data type.")}},function(e,t,n){var i=function(){function e(e,t){for(var n=0;n0;e+=1);return e},l=function(e,t){var i=new Int32Array(e,t+320,5),n=new Int32Array(5),r=new DataView(n.buffer);return r.setInt32(0,i[0],!1),r.setInt32(4,i[1],!1),r.setInt32(8,i[2],!1),r.setInt32(12,i[3],!1),r.setInt32(16,i[4],!1),n},u=function(){function e(t){if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),(t=t||65536)%64>0)throw new Error("Chunk size must be a multiple of 128 bit");this._offset=0,this._maxChunkLen=t,this._padMaxChunkLen=c(t),this._heap=new ArrayBuffer(a(this._padMaxChunkLen+320+20)),this._h32=new Int32Array(this._heap),this._h8=new Int8Array(this._heap),this._core=new n({Int32Array:Int32Array},{},this._heap)}return e.prototype._initState=function(e,t){this._offset=0;var i=new Int32Array(e,t+320,5);i[0]=1732584193,i[1]=-271733879,i[2]=-1732584194,i[3]=271733878,i[4]=-1009589776},e.prototype._padChunk=function(e,t){var i=c(e),n=new Int32Array(this._heap,0,i>>2);return function(e,t){var i=new Uint8Array(e.buffer),n=t%4,r=t-n;switch(n){case 0:i[r+3]=0;case 1:i[r+2]=0;case 2:i[r+1]=0;case 3:i[r+0]=0}for(var s=1+(t>>2);s>2]|=128<<24-(t%4<<3),e[14+(2+(t>>2)&-16)]=i/(1<<29)|0,e[15+(2+(t>>2)&-16)]=i<<3}(n,e,t),i},e.prototype._write=function(e,t,i,n){o(e,this._h8,this._h32,t,i,n||0)},e.prototype._coreCall=function(e,t,i,n,r){var s=i;this._write(e,t,i),r&&(s=this._padChunk(i,n)),this._core.hash(s,this._padMaxChunkLen)},e.prototype.rawDigest=function(e){var t=e.byteLength||e.length||e.size||0;this._initState(this._heap,this._padMaxChunkLen);var i=0,n=this._maxChunkLen;for(i=0;t>i+n;i+=n)this._coreCall(e,i,n,t,!1);return this._coreCall(e,i,t-i,t,!0),l(this._heap,this._padMaxChunkLen)},e.prototype.digest=function(e){return s(this.rawDigest(e).buffer)},e.prototype.digestFromString=function(e){return this.digest(e)},e.prototype.digestFromBuffer=function(e){return this.digest(e)},e.prototype.digestFromArrayBuffer=function(e){return this.digest(e)},e.prototype.resetState=function(){return this._initState(this._heap,this._padMaxChunkLen),this},e.prototype.append=function(e){var t=0,i=e.byteLength||e.length||e.size||0,n=this._offset%this._maxChunkLen,r=void 0;for(this._offset+=i;t0}),!1)}e.exports=function(e,t){t=t||{};var r={main:i.m},s=t.all?{main:Object.keys(r)}:function(e,t){for(var i={main:[t]},n={main:[]},r={main:{}};c(i);)for(var s=Object.keys(i),a=0;a>2]|0;o=n[t+324>>2]|0;l=n[t+328>>2]|0;p=n[t+332>>2]|0;f=n[t+336>>2]|0;for(i=0;(i|0)<(e|0);i=i+64|0){a=s;c=o;u=l;d=p;h=f;for(r=0;(r|0)<64;r=r+4|0){b=n[i+r>>2]|0;m=((s<<5|s>>>27)+(o&l|~o&p)|0)+((b+f|0)+1518500249|0)|0;f=p;p=l;l=o<<30|o>>>2;o=s;s=m;n[e+r>>2]=b}for(r=e+64|0;(r|0)<(e+80|0);r=r+4|0){b=(n[r-12>>2]^n[r-32>>2]^n[r-56>>2]^n[r-64>>2])<<1|(n[r-12>>2]^n[r-32>>2]^n[r-56>>2]^n[r-64>>2])>>>31;m=((s<<5|s>>>27)+(o&l|~o&p)|0)+((b+f|0)+1518500249|0)|0;f=p;p=l;l=o<<30|o>>>2;o=s;s=m;n[r>>2]=b}for(r=e+80|0;(r|0)<(e+160|0);r=r+4|0){b=(n[r-12>>2]^n[r-32>>2]^n[r-56>>2]^n[r-64>>2])<<1|(n[r-12>>2]^n[r-32>>2]^n[r-56>>2]^n[r-64>>2])>>>31;m=((s<<5|s>>>27)+(o^l^p)|0)+((b+f|0)+1859775393|0)|0;f=p;p=l;l=o<<30|o>>>2;o=s;s=m;n[r>>2]=b}for(r=e+160|0;(r|0)<(e+240|0);r=r+4|0){b=(n[r-12>>2]^n[r-32>>2]^n[r-56>>2]^n[r-64>>2])<<1|(n[r-12>>2]^n[r-32>>2]^n[r-56>>2]^n[r-64>>2])>>>31;m=((s<<5|s>>>27)+(o&l|o&p|l&p)|0)+((b+f|0)-1894007588|0)|0;f=p;p=l;l=o<<30|o>>>2;o=s;s=m;n[r>>2]=b}for(r=e+240|0;(r|0)<(e+320|0);r=r+4|0){b=(n[r-12>>2]^n[r-32>>2]^n[r-56>>2]^n[r-64>>2])<<1|(n[r-12>>2]^n[r-32>>2]^n[r-56>>2]^n[r-64>>2])>>>31;m=((s<<5|s>>>27)+(o^l^p)|0)+((b+f|0)-899497514|0)|0;f=p;p=l;l=o<<30|o>>>2;o=s;s=m;n[r>>2]=b}s=s+a|0;o=o+c|0;l=l+u|0;p=p+d|0;f=f+h|0}n[t+320>>2]=s;n[t+324>>2]=o;n[t+328>>2]=l;n[t+332>>2]=p;n[t+336>>2]=f}return{hash:r}}},function(e,t){var i=this,n=void 0;"undefined"!=typeof self&&void 0!==self.FileReaderSync&&(n=new self.FileReaderSync);var r=function(e,t,i,n,r,s){var a=void 0,o=s%4,c=(r+o)%4,l=r-c;switch(o){case 0:t[s]=e[n+3];case 1:t[s+1-(o<<1)|0]=e[n+2];case 2:t[s+2-(o<<1)|0]=e[n+1];case 3:t[s+3-(o<<1)|0]=e[n]}if(!(r>2|0]=e[n+a]<<24|e[n+a+1]<<16|e[n+a+2]<<8|e[n+a+3];switch(c){case 3:t[s+l+1|0]=e[n+l+2];case 2:t[s+l+2|0]=e[n+l+1];case 1:t[s+l+3|0]=e[n+l]}}};e.exports=function(e,t,s,a,o,c){if("string"==typeof e)return function(e,t,i,n,r,s){var a=void 0,o=s%4,c=(r+o)%4,l=r-c;switch(o){case 0:t[s]=e.charCodeAt(n+3);case 1:t[s+1-(o<<1)|0]=e.charCodeAt(n+2);case 2:t[s+2-(o<<1)|0]=e.charCodeAt(n+1);case 3:t[s+3-(o<<1)|0]=e.charCodeAt(n)}if(!(r>2]=e.charCodeAt(n+a)<<24|e.charCodeAt(n+a+1)<<16|e.charCodeAt(n+a+2)<<8|e.charCodeAt(n+a+3);switch(c){case 3:t[s+l+1|0]=e.charCodeAt(n+l+2);case 2:t[s+l+2|0]=e.charCodeAt(n+l+1);case 1:t[s+l+3|0]=e.charCodeAt(n+l)}}}(e,t,s,a,o,c);if(e instanceof Array)return r(e,t,s,a,o,c);if(i&&i.Buffer&&i.Buffer.isBuffer(e))return r(e,t,s,a,o,c);if(e instanceof ArrayBuffer)return r(new Uint8Array(e),t,s,a,o,c);if(e.buffer instanceof ArrayBuffer)return r(new Uint8Array(e.buffer,e.byteOffset,e.byteLength),t,s,a,o,c);if(e instanceof Blob)return function(e,t,i,r,s,a){var o=void 0,c=a%4,l=(s+c)%4,u=s-l,p=new Uint8Array(n.readAsArrayBuffer(e.slice(r,r+s)));switch(c){case 0:t[a]=p[3];case 1:t[a+1-(c<<1)|0]=p[2];case 2:t[a+2-(c<<1)|0]=p[1];case 3:t[a+3-(c<<1)|0]=p[0]}if(!(s>2|0]=p[o]<<24|p[o+1]<<16|p[o+2]<<8|p[o+3];switch(l){case 3:t[a+u+1|0]=p[u+2];case 2:t[a+u+2|0]=p[u+1];case 1:t[a+u+3|0]=p[u]}}}(e,t,s,a,o,c);throw new Error("Unsupported data type.")}},function(e,t,i){var n=function(){function e(e,t){for(var i=0;i */ -var i=e("buffer"),r=i.Buffer;function s(e,t){for(var n in e)t[n]=e[n]}function o(e,t,n){return r(e,t,n)}r.from&&r.alloc&&r.allocUnsafe&&r.allocUnsafeSlow?t.exports=i:(s(i,n),n.Buffer=o),o.prototype=Object.create(r.prototype),s(r,o),o.from=function(e,t,n){if("number"==typeof e)throw new TypeError("Argument must not be a number");return r(e,t,n)},o.alloc=function(e,t,n){if("number"!=typeof e)throw new TypeError("Argument must be a number");var i=r(e);return void 0!==t?"string"==typeof n?i.fill(t,n):i.fill(t):i.fill(0),i},o.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return r(e)},o.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return i.SlowBuffer(e)}},{buffer:116}],387:[function(e,t,n){(function(n){(function(){"use strict";var i,r=e("buffer"),s=r.Buffer,o={};for(i in r)r.hasOwnProperty(i)&&"SlowBuffer"!==i&&"Buffer"!==i&&(o[i]=r[i]);var a=o.Buffer={};for(i in s)s.hasOwnProperty(i)&&"allocUnsafe"!==i&&"allocUnsafeSlow"!==i&&(a[i]=s[i]);if(o.Buffer.prototype=s.prototype,a.from&&a.from!==Uint8Array.from||(a.from=function(e,t,n){if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type '+typeof e);if(e&&void 0===e.length)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);return s(e,t,n)}),a.alloc||(a.alloc=function(e,t,n){if("number"!=typeof e)throw new TypeError('The "size" argument must be of type number. Received type '+typeof e);if(e<0||e>=2*(1<<30))throw new RangeError('The value "'+e+'" is invalid for option "size"');var i=s(e);return t&&0!==t.length?"string"==typeof n?i.fill(t,n):i.fill(t):i.fill(0),i}),!o.kStringMaxLength)try{o.kStringMaxLength=n.binding("buffer").kStringMaxLength}catch(e){}o.constants||(o.constants={MAX_LENGTH:o.kMaxLength},o.kStringMaxLength&&(o.constants.MAX_STRING_LENGTH=o.kStringMaxLength)),t.exports=o}).call(this)}).call(this,e("_process"))},{_process:342,buffer:116}],388:[function(e,t,n){var i=e("safe-buffer").Buffer;function r(e,t){this._block=i.alloc(e),this._finalSize=t,this._blockSize=e,this._len=0}r.prototype.update=function(e,t){"string"==typeof e&&(t=t||"utf8",e=i.from(e,t));for(var n=this._block,r=this._blockSize,s=e.length,o=this._len,a=0;a=this._finalSize&&(this._update(this._block),this._block.fill(0));var n=8*this._len;if(n<=4294967295)this._block.writeUInt32BE(n,this._blockSize-4);else{var i=(4294967295&n)>>>0,r=(n-i)/4294967296;this._block.writeUInt32BE(r,this._blockSize-8),this._block.writeUInt32BE(i,this._blockSize-4)}this._update(this._block);var s=this._hash();return e?s.toString(e):s},r.prototype._update=function(){throw new Error("_update must be implemented by subclass")},t.exports=r},{"safe-buffer":386}],389:[function(e,t,n){(n=t.exports=function(e){e=e.toLowerCase();var t=n[e];if(!t)throw new Error(e+" is not supported (we accept pull requests)");return new t}).sha=e("./sha"),n.sha1=e("./sha1"),n.sha224=e("./sha224"),n.sha256=e("./sha256"),n.sha384=e("./sha384"),n.sha512=e("./sha512")},{"./sha":390,"./sha1":391,"./sha224":392,"./sha256":393,"./sha384":394,"./sha512":395}],390:[function(e,t,n){var i=e("inherits"),r=e("./hash"),s=e("safe-buffer").Buffer,o=[1518500249,1859775393,-1894007588,-899497514],a=new Array(80);function c(){this.init(),this._w=a,r.call(this,64,56)}function u(e){return e<<30|e>>>2}function l(e,t,n,i){return 0===e?t&n|~t&i:2===e?t&n|t&i|n&i:t^n^i}i(c,r),c.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},c.prototype._update=function(e){for(var t,n=this._w,i=0|this._a,r=0|this._b,s=0|this._c,a=0|this._d,c=0|this._e,d=0;d<16;++d)n[d]=e.readInt32BE(4*d);for(;d<80;++d)n[d]=n[d-3]^n[d-8]^n[d-14]^n[d-16];for(var f=0;f<80;++f){var p=~~(f/20),h=0|((t=i)<<5|t>>>27)+l(p,r,s,a)+c+n[f]+o[p];c=a,a=s,s=u(r),r=i,i=h}this._a=i+this._a|0,this._b=r+this._b|0,this._c=s+this._c|0,this._d=a+this._d|0,this._e=c+this._e|0},c.prototype._hash=function(){var e=s.allocUnsafe(20);return e.writeInt32BE(0|this._a,0),e.writeInt32BE(0|this._b,4),e.writeInt32BE(0|this._c,8),e.writeInt32BE(0|this._d,12),e.writeInt32BE(0|this._e,16),e},t.exports=c},{"./hash":388,inherits:249,"safe-buffer":386}],391:[function(e,t,n){var i=e("inherits"),r=e("./hash"),s=e("safe-buffer").Buffer,o=[1518500249,1859775393,-1894007588,-899497514],a=new Array(80);function c(){this.init(),this._w=a,r.call(this,64,56)}function u(e){return e<<5|e>>>27}function l(e){return e<<30|e>>>2}function d(e,t,n,i){return 0===e?t&n|~t&i:2===e?t&n|t&i|n&i:t^n^i}i(c,r),c.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},c.prototype._update=function(e){for(var t,n=this._w,i=0|this._a,r=0|this._b,s=0|this._c,a=0|this._d,c=0|this._e,f=0;f<16;++f)n[f]=e.readInt32BE(4*f);for(;f<80;++f)n[f]=(t=n[f-3]^n[f-8]^n[f-14]^n[f-16])<<1|t>>>31;for(var p=0;p<80;++p){var h=~~(p/20),m=u(i)+d(h,r,s,a)+c+n[p]+o[h]|0;c=a,a=s,s=l(r),r=i,i=m}this._a=i+this._a|0,this._b=r+this._b|0,this._c=s+this._c|0,this._d=a+this._d|0,this._e=c+this._e|0},c.prototype._hash=function(){var e=s.allocUnsafe(20);return e.writeInt32BE(0|this._a,0),e.writeInt32BE(0|this._b,4),e.writeInt32BE(0|this._c,8),e.writeInt32BE(0|this._d,12),e.writeInt32BE(0|this._e,16),e},t.exports=c},{"./hash":388,inherits:249,"safe-buffer":386}],392:[function(e,t,n){var i=e("inherits"),r=e("./sha256"),s=e("./hash"),o=e("safe-buffer").Buffer,a=new Array(64);function c(){this.init(),this._w=a,s.call(this,64,56)}i(c,r),c.prototype.init=function(){return this._a=3238371032,this._b=914150663,this._c=812702999,this._d=4144912697,this._e=4290775857,this._f=1750603025,this._g=1694076839,this._h=3204075428,this},c.prototype._hash=function(){var e=o.allocUnsafe(28);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e},t.exports=c},{"./hash":388,"./sha256":393,inherits:249,"safe-buffer":386}],393:[function(e,t,n){var i=e("inherits"),r=e("./hash"),s=e("safe-buffer").Buffer,o=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],a=new Array(64);function c(){this.init(),this._w=a,r.call(this,64,56)}function u(e,t,n){return n^e&(t^n)}function l(e,t,n){return e&t|n&(e|t)}function d(e){return(e>>>2|e<<30)^(e>>>13|e<<19)^(e>>>22|e<<10)}function f(e){return(e>>>6|e<<26)^(e>>>11|e<<21)^(e>>>25|e<<7)}function p(e){return(e>>>7|e<<25)^(e>>>18|e<<14)^e>>>3}i(c,r),c.prototype.init=function(){return this._a=1779033703,this._b=3144134277,this._c=1013904242,this._d=2773480762,this._e=1359893119,this._f=2600822924,this._g=528734635,this._h=1541459225,this},c.prototype._update=function(e){for(var t,n=this._w,i=0|this._a,r=0|this._b,s=0|this._c,a=0|this._d,c=0|this._e,h=0|this._f,m=0|this._g,b=0|this._h,g=0;g<16;++g)n[g]=e.readInt32BE(4*g);for(;g<64;++g)n[g]=0|(((t=n[g-2])>>>17|t<<15)^(t>>>19|t<<13)^t>>>10)+n[g-7]+p(n[g-15])+n[g-16];for(var v=0;v<64;++v){var y=b+f(c)+u(c,h,m)+o[v]+n[v]|0,_=d(i)+l(i,r,s)|0;b=m,m=h,h=c,c=a+y|0,a=s,s=r,r=i,i=y+_|0}this._a=i+this._a|0,this._b=r+this._b|0,this._c=s+this._c|0,this._d=a+this._d|0,this._e=c+this._e|0,this._f=h+this._f|0,this._g=m+this._g|0,this._h=b+this._h|0},c.prototype._hash=function(){var e=s.allocUnsafe(32);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e.writeInt32BE(this._h,28),e},t.exports=c},{"./hash":388,inherits:249,"safe-buffer":386}],394:[function(e,t,n){var i=e("inherits"),r=e("./sha512"),s=e("./hash"),o=e("safe-buffer").Buffer,a=new Array(160);function c(){this.init(),this._w=a,s.call(this,128,112)}i(c,r),c.prototype.init=function(){return this._ah=3418070365,this._bh=1654270250,this._ch=2438529370,this._dh=355462360,this._eh=1731405415,this._fh=2394180231,this._gh=3675008525,this._hh=1203062813,this._al=3238371032,this._bl=914150663,this._cl=812702999,this._dl=4144912697,this._el=4290775857,this._fl=1750603025,this._gl=1694076839,this._hl=3204075428,this},c.prototype._hash=function(){var e=o.allocUnsafe(48);function t(t,n,i){e.writeInt32BE(t,i),e.writeInt32BE(n,i+4)}return t(this._ah,this._al,0),t(this._bh,this._bl,8),t(this._ch,this._cl,16),t(this._dh,this._dl,24),t(this._eh,this._el,32),t(this._fh,this._fl,40),e},t.exports=c},{"./hash":388,"./sha512":395,inherits:249,"safe-buffer":386}],395:[function(e,t,n){var i=e("inherits"),r=e("./hash"),s=e("safe-buffer").Buffer,o=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591],a=new Array(160);function c(){this.init(),this._w=a,r.call(this,128,112)}function u(e,t,n){return n^e&(t^n)}function l(e,t,n){return e&t|n&(e|t)}function d(e,t){return(e>>>28|t<<4)^(t>>>2|e<<30)^(t>>>7|e<<25)}function f(e,t){return(e>>>14|t<<18)^(e>>>18|t<<14)^(t>>>9|e<<23)}function p(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^e>>>7}function h(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^(e>>>7|t<<25)}function m(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^e>>>6}function b(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^(e>>>6|t<<26)}function g(e,t){return e>>>0>>0?1:0}i(c,r),c.prototype.init=function(){return this._ah=1779033703,this._bh=3144134277,this._ch=1013904242,this._dh=2773480762,this._eh=1359893119,this._fh=2600822924,this._gh=528734635,this._hh=1541459225,this._al=4089235720,this._bl=2227873595,this._cl=4271175723,this._dl=1595750129,this._el=2917565137,this._fl=725511199,this._gl=4215389547,this._hl=327033209,this},c.prototype._update=function(e){for(var t=this._w,n=0|this._ah,i=0|this._bh,r=0|this._ch,s=0|this._dh,a=0|this._eh,c=0|this._fh,v=0|this._gh,y=0|this._hh,_=0|this._al,w=0|this._bl,x=0|this._cl,k=0|this._dl,E=0|this._el,S=0|this._fl,M=0|this._gl,A=0|this._hl,I=0;I<32;I+=2)t[I]=e.readInt32BE(4*I),t[I+1]=e.readInt32BE(4*I+4);for(;I<160;I+=2){var T=t[I-30],j=t[I-30+1],C=p(T,j),B=h(j,T),R=m(T=t[I-4],j=t[I-4+1]),L=b(j,T),O=t[I-14],P=t[I-14+1],U=t[I-32],q=t[I-32+1],N=B+P|0,D=C+O+g(N,B)|0;D=(D=D+R+g(N=N+L|0,L)|0)+U+g(N=N+q|0,q)|0,t[I]=D,t[I+1]=N}for(var z=0;z<160;z+=2){D=t[z],N=t[z+1];var H=l(n,i,r),F=l(_,w,x),W=d(n,_),V=d(_,n),K=f(a,E),$=f(E,a),G=o[z],X=o[z+1],Y=u(a,c,v),Z=u(E,S,M),J=A+$|0,Q=y+K+g(J,A)|0;Q=(Q=(Q=Q+Y+g(J=J+Z|0,Z)|0)+G+g(J=J+X|0,X)|0)+D+g(J=J+N|0,N)|0;var ee=V+F|0,te=W+H+g(ee,V)|0;y=v,A=M,v=c,M=S,c=a,S=E,a=s+Q+g(E=k+J|0,k)|0,s=r,k=x,r=i,x=w,i=n,w=_,n=Q+te+g(_=J+ee|0,J)|0}this._al=this._al+_|0,this._bl=this._bl+w|0,this._cl=this._cl+x|0,this._dl=this._dl+k|0,this._el=this._el+E|0,this._fl=this._fl+S|0,this._gl=this._gl+M|0,this._hl=this._hl+A|0,this._ah=this._ah+n+g(this._al,_)|0,this._bh=this._bh+i+g(this._bl,w)|0,this._ch=this._ch+r+g(this._cl,x)|0,this._dh=this._dh+s+g(this._dl,k)|0,this._eh=this._eh+a+g(this._el,E)|0,this._fh=this._fh+c+g(this._fl,S)|0,this._gh=this._gh+v+g(this._gl,M)|0,this._hh=this._hh+y+g(this._hl,A)|0},c.prototype._hash=function(){var e=s.allocUnsafe(64);function t(t,n,i){e.writeInt32BE(t,i),e.writeInt32BE(n,i+4)}return t(this._ah,this._al,0),t(this._bh,this._bl,8),t(this._ch,this._cl,16),t(this._dh,this._dl,24),t(this._eh,this._el,32),t(this._fh,this._fl,40),t(this._gh,this._gl,48),t(this._hh,this._hl,56),e},t.exports=c},{"./hash":388,inherits:249,"safe-buffer":386}],396:[function(e,t,n){(function(e){(function(){ +var n=e("buffer"),r=n.Buffer;function s(e,t){for(var i in e)t[i]=e[i]}function a(e,t,i){return r(e,t,i)}r.from&&r.alloc&&r.allocUnsafe&&r.allocUnsafeSlow?t.exports=n:(s(n,i),i.Buffer=a),a.prototype=Object.create(r.prototype),s(r,a),a.from=function(e,t,i){if("number"==typeof e)throw new TypeError("Argument must not be a number");return r(e,t,i)},a.alloc=function(e,t,i){if("number"!=typeof e)throw new TypeError("Argument must be a number");var n=r(e);return void 0!==t?"string"==typeof i?n.fill(t,i):n.fill(t):n.fill(0),n},a.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return r(e)},a.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return n.SlowBuffer(e)}},{buffer:110}],384:[function(e,t,i){(function(i){(function(){"use strict";var n,r=e("buffer"),s=r.Buffer,a={};for(n in r)r.hasOwnProperty(n)&&"SlowBuffer"!==n&&"Buffer"!==n&&(a[n]=r[n]);var o=a.Buffer={};for(n in s)s.hasOwnProperty(n)&&"allocUnsafe"!==n&&"allocUnsafeSlow"!==n&&(o[n]=s[n]);if(a.Buffer.prototype=s.prototype,o.from&&o.from!==Uint8Array.from||(o.from=function(e,t,i){if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type '+typeof e);if(e&&void 0===e.length)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);return s(e,t,i)}),o.alloc||(o.alloc=function(e,t,i){if("number"!=typeof e)throw new TypeError('The "size" argument must be of type number. Received type '+typeof e);if(e<0||e>=2*(1<<30))throw new RangeError('The value "'+e+'" is invalid for option "size"');var n=s(e);return t&&0!==t.length?"string"==typeof i?n.fill(t,i):n.fill(t):n.fill(0),n}),!a.kStringMaxLength)try{a.kStringMaxLength=i.binding("buffer").kStringMaxLength}catch(e){}a.constants||(a.constants={MAX_LENGTH:a.kMaxLength},a.kStringMaxLength&&(a.constants.MAX_STRING_LENGTH=a.kStringMaxLength)),t.exports=a}).call(this)}).call(this,e("_process"))},{_process:341,buffer:110}],385:[function(e,t,i){var n=e("safe-buffer").Buffer;function r(e,t){this._block=n.alloc(e),this._finalSize=t,this._blockSize=e,this._len=0}r.prototype.update=function(e,t){"string"==typeof e&&(t=t||"utf8",e=n.from(e,t));for(var i=this._block,r=this._blockSize,s=e.length,a=this._len,o=0;o=this._finalSize&&(this._update(this._block),this._block.fill(0));var i=8*this._len;if(i<=4294967295)this._block.writeUInt32BE(i,this._blockSize-4);else{var n=(4294967295&i)>>>0,r=(i-n)/4294967296;this._block.writeUInt32BE(r,this._blockSize-8),this._block.writeUInt32BE(n,this._blockSize-4)}this._update(this._block);var s=this._hash();return e?s.toString(e):s},r.prototype._update=function(){throw new Error("_update must be implemented by subclass")},t.exports=r},{"safe-buffer":383}],386:[function(e,t,i){(i=t.exports=function(e){e=e.toLowerCase();var t=i[e];if(!t)throw new Error(e+" is not supported (we accept pull requests)");return new t}).sha=e("./sha"),i.sha1=e("./sha1"),i.sha224=e("./sha224"),i.sha256=e("./sha256"),i.sha384=e("./sha384"),i.sha512=e("./sha512")},{"./sha":387,"./sha1":388,"./sha224":389,"./sha256":390,"./sha384":391,"./sha512":392}],387:[function(e,t,i){var n=e("inherits"),r=e("./hash"),s=e("safe-buffer").Buffer,a=[1518500249,1859775393,-1894007588,-899497514],o=new Array(80);function c(){this.init(),this._w=o,r.call(this,64,56)}function l(e){return e<<30|e>>>2}function u(e,t,i,n){return 0===e?t&i|~t&n:2===e?t&i|t&n|i&n:t^i^n}n(c,r),c.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},c.prototype._update=function(e){for(var t,i=this._w,n=0|this._a,r=0|this._b,s=0|this._c,o=0|this._d,c=0|this._e,p=0;p<16;++p)i[p]=e.readInt32BE(4*p);for(;p<80;++p)i[p]=i[p-3]^i[p-8]^i[p-14]^i[p-16];for(var d=0;d<80;++d){var f=~~(d/20),h=0|((t=n)<<5|t>>>27)+u(f,r,s,o)+c+i[d]+a[f];c=o,o=s,s=l(r),r=n,n=h}this._a=n+this._a|0,this._b=r+this._b|0,this._c=s+this._c|0,this._d=o+this._d|0,this._e=c+this._e|0},c.prototype._hash=function(){var e=s.allocUnsafe(20);return e.writeInt32BE(0|this._a,0),e.writeInt32BE(0|this._b,4),e.writeInt32BE(0|this._c,8),e.writeInt32BE(0|this._d,12),e.writeInt32BE(0|this._e,16),e},t.exports=c},{"./hash":385,inherits:246,"safe-buffer":383}],388:[function(e,t,i){var n=e("inherits"),r=e("./hash"),s=e("safe-buffer").Buffer,a=[1518500249,1859775393,-1894007588,-899497514],o=new Array(80);function c(){this.init(),this._w=o,r.call(this,64,56)}function l(e){return e<<5|e>>>27}function u(e){return e<<30|e>>>2}function p(e,t,i,n){return 0===e?t&i|~t&n:2===e?t&i|t&n|i&n:t^i^n}n(c,r),c.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},c.prototype._update=function(e){for(var t,i=this._w,n=0|this._a,r=0|this._b,s=0|this._c,o=0|this._d,c=0|this._e,d=0;d<16;++d)i[d]=e.readInt32BE(4*d);for(;d<80;++d)i[d]=(t=i[d-3]^i[d-8]^i[d-14]^i[d-16])<<1|t>>>31;for(var f=0;f<80;++f){var h=~~(f/20),m=l(n)+p(h,r,s,o)+c+i[f]+a[h]|0;c=o,o=s,s=u(r),r=n,n=m}this._a=n+this._a|0,this._b=r+this._b|0,this._c=s+this._c|0,this._d=o+this._d|0,this._e=c+this._e|0},c.prototype._hash=function(){var e=s.allocUnsafe(20);return e.writeInt32BE(0|this._a,0),e.writeInt32BE(0|this._b,4),e.writeInt32BE(0|this._c,8),e.writeInt32BE(0|this._d,12),e.writeInt32BE(0|this._e,16),e},t.exports=c},{"./hash":385,inherits:246,"safe-buffer":383}],389:[function(e,t,i){var n=e("inherits"),r=e("./sha256"),s=e("./hash"),a=e("safe-buffer").Buffer,o=new Array(64);function c(){this.init(),this._w=o,s.call(this,64,56)}n(c,r),c.prototype.init=function(){return this._a=3238371032,this._b=914150663,this._c=812702999,this._d=4144912697,this._e=4290775857,this._f=1750603025,this._g=1694076839,this._h=3204075428,this},c.prototype._hash=function(){var e=a.allocUnsafe(28);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e},t.exports=c},{"./hash":385,"./sha256":390,inherits:246,"safe-buffer":383}],390:[function(e,t,i){var n=e("inherits"),r=e("./hash"),s=e("safe-buffer").Buffer,a=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],o=new Array(64);function c(){this.init(),this._w=o,r.call(this,64,56)}function l(e,t,i){return i^e&(t^i)}function u(e,t,i){return e&t|i&(e|t)}function p(e){return(e>>>2|e<<30)^(e>>>13|e<<19)^(e>>>22|e<<10)}function d(e){return(e>>>6|e<<26)^(e>>>11|e<<21)^(e>>>25|e<<7)}function f(e){return(e>>>7|e<<25)^(e>>>18|e<<14)^e>>>3}n(c,r),c.prototype.init=function(){return this._a=1779033703,this._b=3144134277,this._c=1013904242,this._d=2773480762,this._e=1359893119,this._f=2600822924,this._g=528734635,this._h=1541459225,this},c.prototype._update=function(e){for(var t,i=this._w,n=0|this._a,r=0|this._b,s=0|this._c,o=0|this._d,c=0|this._e,h=0|this._f,m=0|this._g,b=0|this._h,v=0;v<16;++v)i[v]=e.readInt32BE(4*v);for(;v<64;++v)i[v]=0|(((t=i[v-2])>>>17|t<<15)^(t>>>19|t<<13)^t>>>10)+i[v-7]+f(i[v-15])+i[v-16];for(var g=0;g<64;++g){var y=b+d(c)+l(c,h,m)+a[g]+i[g]|0,_=p(n)+u(n,r,s)|0;b=m,m=h,h=c,c=o+y|0,o=s,s=r,r=n,n=y+_|0}this._a=n+this._a|0,this._b=r+this._b|0,this._c=s+this._c|0,this._d=o+this._d|0,this._e=c+this._e|0,this._f=h+this._f|0,this._g=m+this._g|0,this._h=b+this._h|0},c.prototype._hash=function(){var e=s.allocUnsafe(32);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e.writeInt32BE(this._h,28),e},t.exports=c},{"./hash":385,inherits:246,"safe-buffer":383}],391:[function(e,t,i){var n=e("inherits"),r=e("./sha512"),s=e("./hash"),a=e("safe-buffer").Buffer,o=new Array(160);function c(){this.init(),this._w=o,s.call(this,128,112)}n(c,r),c.prototype.init=function(){return this._ah=3418070365,this._bh=1654270250,this._ch=2438529370,this._dh=355462360,this._eh=1731405415,this._fh=2394180231,this._gh=3675008525,this._hh=1203062813,this._al=3238371032,this._bl=914150663,this._cl=812702999,this._dl=4144912697,this._el=4290775857,this._fl=1750603025,this._gl=1694076839,this._hl=3204075428,this},c.prototype._hash=function(){var e=a.allocUnsafe(48);function t(t,i,n){e.writeInt32BE(t,n),e.writeInt32BE(i,n+4)}return t(this._ah,this._al,0),t(this._bh,this._bl,8),t(this._ch,this._cl,16),t(this._dh,this._dl,24),t(this._eh,this._el,32),t(this._fh,this._fl,40),e},t.exports=c},{"./hash":385,"./sha512":392,inherits:246,"safe-buffer":383}],392:[function(e,t,i){var n=e("inherits"),r=e("./hash"),s=e("safe-buffer").Buffer,a=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591],o=new Array(160);function c(){this.init(),this._w=o,r.call(this,128,112)}function l(e,t,i){return i^e&(t^i)}function u(e,t,i){return e&t|i&(e|t)}function p(e,t){return(e>>>28|t<<4)^(t>>>2|e<<30)^(t>>>7|e<<25)}function d(e,t){return(e>>>14|t<<18)^(e>>>18|t<<14)^(t>>>9|e<<23)}function f(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^e>>>7}function h(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^(e>>>7|t<<25)}function m(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^e>>>6}function b(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^(e>>>6|t<<26)}function v(e,t){return e>>>0>>0?1:0}n(c,r),c.prototype.init=function(){return this._ah=1779033703,this._bh=3144134277,this._ch=1013904242,this._dh=2773480762,this._eh=1359893119,this._fh=2600822924,this._gh=528734635,this._hh=1541459225,this._al=4089235720,this._bl=2227873595,this._cl=4271175723,this._dl=1595750129,this._el=2917565137,this._fl=725511199,this._gl=4215389547,this._hl=327033209,this},c.prototype._update=function(e){for(var t=this._w,i=0|this._ah,n=0|this._bh,r=0|this._ch,s=0|this._dh,o=0|this._eh,c=0|this._fh,g=0|this._gh,y=0|this._hh,_=0|this._al,x=0|this._bl,w=0|this._cl,k=0|this._dl,E=0|this._el,S=0|this._fl,M=0|this._gl,A=0|this._hl,j=0;j<32;j+=2)t[j]=e.readInt32BE(4*j),t[j+1]=e.readInt32BE(4*j+4);for(;j<160;j+=2){var I=t[j-30],T=t[j-30+1],C=f(I,T),B=h(T,I),R=m(I=t[j-4],T=t[j-4+1]),L=b(T,I),O=t[j-14],P=t[j-14+1],U=t[j-32],q=t[j-32+1],N=B+P|0,D=C+O+v(N,B)|0;D=(D=D+R+v(N=N+L|0,L)|0)+U+v(N=N+q|0,q)|0,t[j]=D,t[j+1]=N}for(var z=0;z<160;z+=2){D=t[z],N=t[z+1];var H=u(i,n,r),F=u(_,x,w),W=p(i,_),K=p(_,i),V=d(o,E),$=d(E,o),G=a[z],X=a[z+1],Y=l(o,c,g),Z=l(E,S,M),J=A+$|0,Q=y+V+v(J,A)|0;Q=(Q=(Q=Q+Y+v(J=J+Z|0,Z)|0)+G+v(J=J+X|0,X)|0)+D+v(J=J+N|0,N)|0;var ee=K+F|0,te=W+H+v(ee,K)|0;y=g,A=M,g=c,M=S,c=o,S=E,o=s+Q+v(E=k+J|0,k)|0,s=r,k=w,r=n,w=x,n=i,x=_,i=Q+te+v(_=J+ee|0,J)|0}this._al=this._al+_|0,this._bl=this._bl+x|0,this._cl=this._cl+w|0,this._dl=this._dl+k|0,this._el=this._el+E|0,this._fl=this._fl+S|0,this._gl=this._gl+M|0,this._hl=this._hl+A|0,this._ah=this._ah+i+v(this._al,_)|0,this._bh=this._bh+n+v(this._bl,x)|0,this._ch=this._ch+r+v(this._cl,w)|0,this._dh=this._dh+s+v(this._dl,k)|0,this._eh=this._eh+o+v(this._el,E)|0,this._fh=this._fh+c+v(this._fl,S)|0,this._gh=this._gh+g+v(this._gl,M)|0,this._hh=this._hh+y+v(this._hl,A)|0},c.prototype._hash=function(){var e=s.allocUnsafe(64);function t(t,i,n){e.writeInt32BE(t,n),e.writeInt32BE(i,n+4)}return t(this._ah,this._al,0),t(this._bh,this._bl,8),t(this._ch,this._cl,16),t(this._dh,this._dl,24),t(this._eh,this._el,32),t(this._fh,this._fl,40),t(this._gh,this._gl,48),t(this._hh,this._hl,56),e},t.exports=c},{"./hash":385,inherits:246,"safe-buffer":383}],393:[function(e,t,i){(function(e){(function(){ /*! simple-concat. MIT License. Feross Aboukhadijeh */ -t.exports=function(t,n){var i=[];t.on("data",(function(e){i.push(e)})),t.once("end",(function(){n&&n(null,e.concat(i)),n=null})),t.once("error",(function(e){n&&n(e),n=null}))}}).call(this)}).call(this,e("buffer").Buffer)},{buffer:116}],397:[function(e,t,n){(function(n){(function(){ +t.exports=function(t,i){var n=[];t.on("data",(function(e){n.push(e)})),t.once("end",(function(){i&&i(null,e.concat(n)),i=null})),t.once("error",(function(e){i&&i(e),i=null}))}}).call(this)}).call(this,e("buffer").Buffer)},{buffer:110}],394:[function(e,t,i){(function(i){(function(){ /*! simple-get. MIT License. Feross Aboukhadijeh */ -t.exports=d;const i=e("simple-concat"),r=e("decompress-response"),s=e("http"),o=e("https"),a=e("once"),c=e("querystring"),u=e("url"),l=e=>null!==e&&"object"==typeof e&&"function"==typeof e.pipe;function d(e,t){if(e=Object.assign({maxRedirects:10},"string"==typeof e?{url:e}:e),t=a(t),e.url){const{hostname:t,port:n,protocol:i,auth:r,path:s}=u.parse(e.url);delete e.url,t||n||i||r?Object.assign(e,{hostname:t,port:n,protocol:i,auth:r,path:s}):e.path=s}const i={"accept-encoding":"gzip, deflate"};let f;e.headers&&Object.keys(e.headers).forEach((t=>i[t.toLowerCase()]=e.headers[t])),e.headers=i,e.body?f=e.json&&!l(e.body)?JSON.stringify(e.body):e.body:e.form&&(f="string"==typeof e.form?e.form:c.stringify(e.form),e.headers["content-type"]="application/x-www-form-urlencoded"),f&&(e.method||(e.method="POST"),l(f)||(e.headers["content-length"]=n.byteLength(f)),e.json&&!e.form&&(e.headers["content-type"]="application/json")),delete e.body,delete e.form,e.json&&(e.headers.accept="application/json"),e.method&&(e.method=e.method.toUpperCase());const p=("https:"===e.protocol?o:s).request(e,(n=>{if(!1!==e.followRedirects&&n.statusCode>=300&&n.statusCode<400&&n.headers.location)return e.url=n.headers.location,delete e.headers.host,n.resume(),"POST"===e.method&&[301,302].includes(n.statusCode)&&(e.method="GET",delete e.headers["content-length"],delete e.headers["content-type"]),0==e.maxRedirects--?t(new Error("too many redirects")):d(e,t);const i="function"==typeof r&&"HEAD"!==e.method;t(null,i?r(n):n)}));return p.on("timeout",(()=>{p.abort(),t(new Error("Request timed out"))})),p.on("error",t),l(f)?f.on("error",t).pipe(p):p.end(f),p}d.concat=(e,t)=>d(e,((n,r)=>{if(n)return t(n);i(r,((n,i)=>{if(n)return t(n);if(e.json)try{i=JSON.parse(i.toString())}catch(n){return t(n,r,i)}t(null,r,i)}))})),["get","post","put","patch","head","delete"].forEach((e=>{d[e]=(t,n)=>("string"==typeof t&&(t={url:t}),d(Object.assign({method:e.toUpperCase()},t),n))}))}).call(this)}).call(this,e("buffer").Buffer)},{buffer:116,"decompress-response":73,http:458,https:246,once:327,querystring:354,"simple-concat":396,url:494}],398:[function(e,t,n){ +t.exports=p;const n=e("simple-concat"),r=e("decompress-response"),s=e("http"),a=e("https"),o=e("once"),c=e("querystring"),l=e("url"),u=e=>null!==e&&"object"==typeof e&&"function"==typeof e.pipe;function p(e,t){if(e=Object.assign({maxRedirects:10},"string"==typeof e?{url:e}:e),t=o(t),e.url){const{hostname:t,port:i,protocol:n,auth:r,path:s}=l.parse(e.url);delete e.url,t||i||n||r?Object.assign(e,{hostname:t,port:i,protocol:n,auth:r,path:s}):e.path=s}const n={"accept-encoding":"gzip, deflate"};let d;e.headers&&Object.keys(e.headers).forEach((t=>n[t.toLowerCase()]=e.headers[t])),e.headers=n,e.body?d=e.json&&!u(e.body)?JSON.stringify(e.body):e.body:e.form&&(d="string"==typeof e.form?e.form:c.stringify(e.form),e.headers["content-type"]="application/x-www-form-urlencoded"),d&&(e.method||(e.method="POST"),u(d)||(e.headers["content-length"]=i.byteLength(d)),e.json&&!e.form&&(e.headers["content-type"]="application/json")),delete e.body,delete e.form,e.json&&(e.headers.accept="application/json"),e.method&&(e.method=e.method.toUpperCase());const f=("https:"===e.protocol?a:s).request(e,(i=>{if(!1!==e.followRedirects&&i.statusCode>=300&&i.statusCode<400&&i.headers.location)return e.url=i.headers.location,delete e.headers.host,i.resume(),"POST"===e.method&&[301,302].includes(i.statusCode)&&(e.method="GET",delete e.headers["content-length"],delete e.headers["content-type"]),0==e.maxRedirects--?t(new Error("too many redirects")):p(e,t);const n="function"==typeof r&&"HEAD"!==e.method;t(null,n?r(i):i)}));return f.on("timeout",(()=>{f.abort(),t(new Error("Request timed out"))})),f.on("error",t),u(d)?d.on("error",t).pipe(f):f.end(d),f}p.concat=(e,t)=>p(e,((i,r)=>{if(i)return t(i);n(r,((i,n)=>{if(i)return t(i);if(e.json)try{n=JSON.parse(n.toString())}catch(i){return t(i,r,n)}t(null,r,n)}))})),["get","post","put","patch","head","delete"].forEach((e=>{p[e]=(t,i)=>("string"==typeof t&&(t={url:t}),p(Object.assign({method:e.toUpperCase()},t),i))}))}).call(this)}).call(this,e("buffer").Buffer)},{buffer:110,"decompress-response":67,http:449,https:243,once:326,querystring:353,"simple-concat":393,url:482}],395:[function(e,t,i){ /*! simple-peer. MIT License. Feross Aboukhadijeh */ -const i=e("debug")("simple-peer"),r=e("get-browser-rtc"),s=e("randombytes"),o=e("readable-stream"),a=e("queue-microtask"),c=e("err-code"),{Buffer:u}=e("buffer"),l=65536;function d(e){return e.replace(/a=ice-options:trickle\s\n/g,"")}class f extends o.Duplex{constructor(e){if(super(e=Object.assign({allowHalfOpen:!1},e)),this._id=s(4).toString("hex").slice(0,7),this._debug("new peer %o",e),this.channelName=e.initiator?e.channelName||s(20).toString("hex"):null,this.initiator=e.initiator||!1,this.channelConfig=e.channelConfig||f.channelConfig,this.channelNegotiated=this.channelConfig.negotiated,this.config=Object.assign({},f.config,e.config),this.offerOptions=e.offerOptions||{},this.answerOptions=e.answerOptions||{},this.sdpTransform=e.sdpTransform||(e=>e),this.streams=e.streams||(e.stream?[e.stream]:[]),this.trickle=void 0===e.trickle||e.trickle,this.allowHalfTrickle=void 0!==e.allowHalfTrickle&&e.allowHalfTrickle,this.iceCompleteTimeout=e.iceCompleteTimeout||5e3,this.destroyed=!1,this.destroying=!1,this._connected=!1,this.remoteAddress=void 0,this.remoteFamily=void 0,this.remotePort=void 0,this.localAddress=void 0,this.localFamily=void 0,this.localPort=void 0,this._wrtc=e.wrtc&&"object"==typeof e.wrtc?e.wrtc:r(),!this._wrtc)throw"undefined"==typeof window?c(new Error("No WebRTC support: Specify `opts.wrtc` option in this environment"),"ERR_WEBRTC_SUPPORT"):c(new Error("No WebRTC support: Not a supported browser"),"ERR_WEBRTC_SUPPORT");this._pcReady=!1,this._channelReady=!1,this._iceComplete=!1,this._iceCompleteTimer=null,this._channel=null,this._pendingCandidates=[],this._isNegotiating=!1,this._firstNegotiation=!0,this._batchedNegotiation=!1,this._queuedNegotiation=!1,this._sendersAwaitingStable=[],this._senderMap=new Map,this._closingInterval=null,this._remoteTracks=[],this._remoteStreams=[],this._chunk=null,this._cb=null,this._interval=null;try{this._pc=new this._wrtc.RTCPeerConnection(this.config)}catch(e){return void this.destroy(c(e,"ERR_PC_CONSTRUCTOR"))}this._isReactNativeWebrtc="number"==typeof this._pc._peerConnectionId,this._pc.oniceconnectionstatechange=()=>{this._onIceStateChange()},this._pc.onicegatheringstatechange=()=>{this._onIceStateChange()},this._pc.onconnectionstatechange=()=>{this._onConnectionStateChange()},this._pc.onsignalingstatechange=()=>{this._onSignalingStateChange()},this._pc.onicecandidate=e=>{this._onIceCandidate(e)},"object"==typeof this._pc.peerIdentity&&this._pc.peerIdentity.catch((e=>{this.destroy(c(e,"ERR_PC_PEER_IDENTITY"))})),this.initiator||this.channelNegotiated?this._setupData({channel:this._pc.createDataChannel(this.channelName,this.channelConfig)}):this._pc.ondatachannel=e=>{this._setupData(e)},this.streams&&this.streams.forEach((e=>{this.addStream(e)})),this._pc.ontrack=e=>{this._onTrack(e)},this._debug("initial negotiation"),this._needsNegotiation(),this._onFinishBound=()=>{this._onFinish()},this.once("finish",this._onFinishBound)}get bufferSize(){return this._channel&&this._channel.bufferedAmount||0}get connected(){return this._connected&&"open"===this._channel.readyState}address(){return{port:this.localPort,family:this.localFamily,address:this.localAddress}}signal(e){if(!this.destroying){if(this.destroyed)throw c(new Error("cannot signal after peer is destroyed"),"ERR_DESTROYED");if("string"==typeof e)try{e=JSON.parse(e)}catch(t){e={}}this._debug("signal()"),e.renegotiate&&this.initiator&&(this._debug("got request to renegotiate"),this._needsNegotiation()),e.transceiverRequest&&this.initiator&&(this._debug("got request for transceiver"),this.addTransceiver(e.transceiverRequest.kind,e.transceiverRequest.init)),e.candidate&&(this._pc.remoteDescription&&this._pc.remoteDescription.type?this._addIceCandidate(e.candidate):this._pendingCandidates.push(e.candidate)),e.sdp&&this._pc.setRemoteDescription(new this._wrtc.RTCSessionDescription(e)).then((()=>{this.destroyed||(this._pendingCandidates.forEach((e=>{this._addIceCandidate(e)})),this._pendingCandidates=[],"offer"===this._pc.remoteDescription.type&&this._createAnswer())})).catch((e=>{this.destroy(c(e,"ERR_SET_REMOTE_DESCRIPTION"))})),e.sdp||e.candidate||e.renegotiate||e.transceiverRequest||this.destroy(c(new Error("signal() called with invalid signal data"),"ERR_SIGNALING"))}}_addIceCandidate(e){const t=new this._wrtc.RTCIceCandidate(e);this._pc.addIceCandidate(t).catch((e=>{var n;!t.address||t.address.endsWith(".local")?(n="Ignoring unsupported ICE candidate.",console.warn(n)):this.destroy(c(e,"ERR_ADD_ICE_CANDIDATE"))}))}send(e){if(!this.destroying){if(this.destroyed)throw c(new Error("cannot send after peer is destroyed"),"ERR_DESTROYED");this._channel.send(e)}}addTransceiver(e,t){if(!this.destroying){if(this.destroyed)throw c(new Error("cannot addTransceiver after peer is destroyed"),"ERR_DESTROYED");if(this._debug("addTransceiver()"),this.initiator)try{this._pc.addTransceiver(e,t),this._needsNegotiation()}catch(e){this.destroy(c(e,"ERR_ADD_TRANSCEIVER"))}else this.emit("signal",{type:"transceiverRequest",transceiverRequest:{kind:e,init:t}})}}addStream(e){if(!this.destroying){if(this.destroyed)throw c(new Error("cannot addStream after peer is destroyed"),"ERR_DESTROYED");this._debug("addStream()"),e.getTracks().forEach((t=>{this.addTrack(t,e)}))}}addTrack(e,t){if(this.destroying)return;if(this.destroyed)throw c(new Error("cannot addTrack after peer is destroyed"),"ERR_DESTROYED");this._debug("addTrack()");const n=this._senderMap.get(e)||new Map;let i=n.get(t);if(i)throw i.removed?c(new Error("Track has been removed. You should enable/disable tracks that you want to re-add."),"ERR_SENDER_REMOVED"):c(new Error("Track has already been added to that stream."),"ERR_SENDER_ALREADY_ADDED");i=this._pc.addTrack(e,t),n.set(t,i),this._senderMap.set(e,n),this._needsNegotiation()}replaceTrack(e,t,n){if(this.destroying)return;if(this.destroyed)throw c(new Error("cannot replaceTrack after peer is destroyed"),"ERR_DESTROYED");this._debug("replaceTrack()");const i=this._senderMap.get(e),r=i?i.get(n):null;if(!r)throw c(new Error("Cannot replace track that was never added."),"ERR_TRACK_NOT_ADDED");t&&this._senderMap.set(t,i),null!=r.replaceTrack?r.replaceTrack(t):this.destroy(c(new Error("replaceTrack is not supported in this browser"),"ERR_UNSUPPORTED_REPLACETRACK"))}removeTrack(e,t){if(this.destroying)return;if(this.destroyed)throw c(new Error("cannot removeTrack after peer is destroyed"),"ERR_DESTROYED");this._debug("removeSender()");const n=this._senderMap.get(e),i=n?n.get(t):null;if(!i)throw c(new Error("Cannot remove track that was never added."),"ERR_TRACK_NOT_ADDED");try{i.removed=!0,this._pc.removeTrack(i)}catch(e){"NS_ERROR_UNEXPECTED"===e.name?this._sendersAwaitingStable.push(i):this.destroy(c(e,"ERR_REMOVE_TRACK"))}this._needsNegotiation()}removeStream(e){if(!this.destroying){if(this.destroyed)throw c(new Error("cannot removeStream after peer is destroyed"),"ERR_DESTROYED");this._debug("removeSenders()"),e.getTracks().forEach((t=>{this.removeTrack(t,e)}))}}_needsNegotiation(){this._debug("_needsNegotiation"),this._batchedNegotiation||(this._batchedNegotiation=!0,a((()=>{this._batchedNegotiation=!1,this.initiator||!this._firstNegotiation?(this._debug("starting batched negotiation"),this.negotiate()):this._debug("non-initiator initial negotiation request discarded"),this._firstNegotiation=!1})))}negotiate(){if(!this.destroying){if(this.destroyed)throw c(new Error("cannot negotiate after peer is destroyed"),"ERR_DESTROYED");this.initiator?this._isNegotiating?(this._queuedNegotiation=!0,this._debug("already negotiating, queueing")):(this._debug("start negotiation"),setTimeout((()=>{this._createOffer()}),0)):this._isNegotiating?(this._queuedNegotiation=!0,this._debug("already negotiating, queueing")):(this._debug("requesting negotiation from initiator"),this.emit("signal",{type:"renegotiate",renegotiate:!0})),this._isNegotiating=!0}}destroy(e){this._destroy(e,(()=>{}))}_destroy(e,t){this.destroyed||this.destroying||(this.destroying=!0,this._debug("destroying (error: %s)",e&&(e.message||e)),a((()=>{if(this.destroyed=!0,this.destroying=!1,this._debug("destroy (error: %s)",e&&(e.message||e)),this.readable=this.writable=!1,this._readableState.ended||this.push(null),this._writableState.finished||this.end(),this._connected=!1,this._pcReady=!1,this._channelReady=!1,this._remoteTracks=null,this._remoteStreams=null,this._senderMap=null,clearInterval(this._closingInterval),this._closingInterval=null,clearInterval(this._interval),this._interval=null,this._chunk=null,this._cb=null,this._onFinishBound&&this.removeListener("finish",this._onFinishBound),this._onFinishBound=null,this._channel){try{this._channel.close()}catch(e){}this._channel.onmessage=null,this._channel.onopen=null,this._channel.onclose=null,this._channel.onerror=null}if(this._pc){try{this._pc.close()}catch(e){}this._pc.oniceconnectionstatechange=null,this._pc.onicegatheringstatechange=null,this._pc.onsignalingstatechange=null,this._pc.onicecandidate=null,this._pc.ontrack=null,this._pc.ondatachannel=null}this._pc=null,this._channel=null,e&&this.emit("error",e),this.emit("close"),t()})))}_setupData(e){if(!e.channel)return this.destroy(c(new Error("Data channel event is missing `channel` property"),"ERR_DATA_CHANNEL"));this._channel=e.channel,this._channel.binaryType="arraybuffer","number"==typeof this._channel.bufferedAmountLowThreshold&&(this._channel.bufferedAmountLowThreshold=l),this.channelName=this._channel.label,this._channel.onmessage=e=>{this._onChannelMessage(e)},this._channel.onbufferedamountlow=()=>{this._onChannelBufferedAmountLow()},this._channel.onopen=()=>{this._onChannelOpen()},this._channel.onclose=()=>{this._onChannelClose()},this._channel.onerror=e=>{const t=e.error instanceof Error?e.error:new Error(`Datachannel error: ${e.message} ${e.filename}:${e.lineno}:${e.colno}`);this.destroy(c(t,"ERR_DATA_CHANNEL"))};let t=!1;this._closingInterval=setInterval((()=>{this._channel&&"closing"===this._channel.readyState?(t&&this._onChannelClose(),t=!0):t=!1}),5e3)}_read(){}_write(e,t,n){if(this.destroyed)return n(c(new Error("cannot write after peer is destroyed"),"ERR_DATA_CHANNEL"));if(this._connected){try{this.send(e)}catch(e){return this.destroy(c(e,"ERR_DATA_CHANNEL"))}this._channel.bufferedAmount>l?(this._debug("start backpressure: bufferedAmount %d",this._channel.bufferedAmount),this._cb=n):n(null)}else this._debug("write before connect"),this._chunk=e,this._cb=n}_onFinish(){if(this.destroyed)return;const e=()=>{setTimeout((()=>this.destroy()),1e3)};this._connected?e():this.once("connect",e)}_startIceCompleteTimeout(){this.destroyed||this._iceCompleteTimer||(this._debug("started iceComplete timeout"),this._iceCompleteTimer=setTimeout((()=>{this._iceComplete||(this._iceComplete=!0,this._debug("iceComplete timeout completed"),this.emit("iceTimeout"),this.emit("_iceComplete"))}),this.iceCompleteTimeout))}_createOffer(){this.destroyed||this._pc.createOffer(this.offerOptions).then((e=>{if(this.destroyed)return;this.trickle||this.allowHalfTrickle||(e.sdp=d(e.sdp)),e.sdp=this.sdpTransform(e.sdp);const t=()=>{if(this.destroyed)return;const t=this._pc.localDescription||e;this._debug("signal"),this.emit("signal",{type:t.type,sdp:t.sdp})};this._pc.setLocalDescription(e).then((()=>{this._debug("createOffer success"),this.destroyed||(this.trickle||this._iceComplete?t():this.once("_iceComplete",t))})).catch((e=>{this.destroy(c(e,"ERR_SET_LOCAL_DESCRIPTION"))}))})).catch((e=>{this.destroy(c(e,"ERR_CREATE_OFFER"))}))}_requestMissingTransceivers(){this._pc.getTransceivers&&this._pc.getTransceivers().forEach((e=>{e.mid||!e.sender.track||e.requested||(e.requested=!0,this.addTransceiver(e.sender.track.kind))}))}_createAnswer(){this.destroyed||this._pc.createAnswer(this.answerOptions).then((e=>{if(this.destroyed)return;this.trickle||this.allowHalfTrickle||(e.sdp=d(e.sdp)),e.sdp=this.sdpTransform(e.sdp);const t=()=>{if(this.destroyed)return;const t=this._pc.localDescription||e;this._debug("signal"),this.emit("signal",{type:t.type,sdp:t.sdp}),this.initiator||this._requestMissingTransceivers()};this._pc.setLocalDescription(e).then((()=>{this.destroyed||(this.trickle||this._iceComplete?t():this.once("_iceComplete",t))})).catch((e=>{this.destroy(c(e,"ERR_SET_LOCAL_DESCRIPTION"))}))})).catch((e=>{this.destroy(c(e,"ERR_CREATE_ANSWER"))}))}_onConnectionStateChange(){this.destroyed||"failed"===this._pc.connectionState&&this.destroy(c(new Error("Connection failed."),"ERR_CONNECTION_FAILURE"))}_onIceStateChange(){if(this.destroyed)return;const e=this._pc.iceConnectionState,t=this._pc.iceGatheringState;this._debug("iceStateChange (connection: %s) (gathering: %s)",e,t),this.emit("iceStateChange",e,t),"connected"!==e&&"completed"!==e||(this._pcReady=!0,this._maybeReady()),"failed"===e&&this.destroy(c(new Error("Ice connection failed."),"ERR_ICE_CONNECTION_FAILURE")),"closed"===e&&this.destroy(c(new Error("Ice connection closed."),"ERR_ICE_CONNECTION_CLOSED"))}getStats(e){const t=e=>("[object Array]"===Object.prototype.toString.call(e.values)&&e.values.forEach((t=>{Object.assign(e,t)})),e);0===this._pc.getStats.length||this._isReactNativeWebrtc?this._pc.getStats().then((n=>{const i=[];n.forEach((e=>{i.push(t(e))})),e(null,i)}),(t=>e(t))):this._pc.getStats.length>0?this._pc.getStats((n=>{if(this.destroyed)return;const i=[];n.result().forEach((e=>{const n={};e.names().forEach((t=>{n[t]=e.stat(t)})),n.id=e.id,n.type=e.type,n.timestamp=e.timestamp,i.push(t(n))})),e(null,i)}),(t=>e(t))):e(null,[])}_maybeReady(){if(this._debug("maybeReady pc %s channel %s",this._pcReady,this._channelReady),this._connected||this._connecting||!this._pcReady||!this._channelReady)return;this._connecting=!0;const e=()=>{this.destroyed||this.getStats(((t,n)=>{if(this.destroyed)return;t&&(n=[]);const i={},r={},s={};let o=!1;n.forEach((e=>{"remotecandidate"!==e.type&&"remote-candidate"!==e.type||(i[e.id]=e),"localcandidate"!==e.type&&"local-candidate"!==e.type||(r[e.id]=e),"candidatepair"!==e.type&&"candidate-pair"!==e.type||(s[e.id]=e)}));const a=e=>{o=!0;let t=r[e.localCandidateId];t&&(t.ip||t.address)?(this.localAddress=t.ip||t.address,this.localPort=Number(t.port)):t&&t.ipAddress?(this.localAddress=t.ipAddress,this.localPort=Number(t.portNumber)):"string"==typeof e.googLocalAddress&&(t=e.googLocalAddress.split(":"),this.localAddress=t[0],this.localPort=Number(t[1])),this.localAddress&&(this.localFamily=this.localAddress.includes(":")?"IPv6":"IPv4");let n=i[e.remoteCandidateId];n&&(n.ip||n.address)?(this.remoteAddress=n.ip||n.address,this.remotePort=Number(n.port)):n&&n.ipAddress?(this.remoteAddress=n.ipAddress,this.remotePort=Number(n.portNumber)):"string"==typeof e.googRemoteAddress&&(n=e.googRemoteAddress.split(":"),this.remoteAddress=n[0],this.remotePort=Number(n[1])),this.remoteAddress&&(this.remoteFamily=this.remoteAddress.includes(":")?"IPv6":"IPv4"),this._debug("connect local: %s:%s remote: %s:%s",this.localAddress,this.localPort,this.remoteAddress,this.remotePort)};if(n.forEach((e=>{"transport"===e.type&&e.selectedCandidatePairId&&a(s[e.selectedCandidatePairId]),("googCandidatePair"===e.type&&"true"===e.googActiveConnection||("candidatepair"===e.type||"candidate-pair"===e.type)&&e.selected)&&a(e)})),o||Object.keys(s).length&&!Object.keys(r).length){if(this._connecting=!1,this._connected=!0,this._chunk){try{this.send(this._chunk)}catch(t){return this.destroy(c(t,"ERR_DATA_CHANNEL"))}this._chunk=null,this._debug('sent chunk from "write before connect"');const e=this._cb;this._cb=null,e(null)}"number"!=typeof this._channel.bufferedAmountLowThreshold&&(this._interval=setInterval((()=>this._onInterval()),150),this._interval.unref&&this._interval.unref()),this._debug("connect"),this.emit("connect")}else setTimeout(e,100)}))};e()}_onInterval(){!this._cb||!this._channel||this._channel.bufferedAmount>l||this._onChannelBufferedAmountLow()}_onSignalingStateChange(){this.destroyed||("stable"===this._pc.signalingState&&(this._isNegotiating=!1,this._debug("flushing sender queue",this._sendersAwaitingStable),this._sendersAwaitingStable.forEach((e=>{this._pc.removeTrack(e),this._queuedNegotiation=!0})),this._sendersAwaitingStable=[],this._queuedNegotiation?(this._debug("flushing negotiation queue"),this._queuedNegotiation=!1,this._needsNegotiation()):(this._debug("negotiated"),this.emit("negotiated"))),this._debug("signalingStateChange %s",this._pc.signalingState),this.emit("signalingStateChange",this._pc.signalingState))}_onIceCandidate(e){this.destroyed||(e.candidate&&this.trickle?this.emit("signal",{type:"candidate",candidate:{candidate:e.candidate.candidate,sdpMLineIndex:e.candidate.sdpMLineIndex,sdpMid:e.candidate.sdpMid}}):e.candidate||this._iceComplete||(this._iceComplete=!0,this.emit("_iceComplete")),e.candidate&&this._startIceCompleteTimeout())}_onChannelMessage(e){if(this.destroyed)return;let t=e.data;t instanceof ArrayBuffer&&(t=u.from(t)),this.push(t)}_onChannelBufferedAmountLow(){if(this.destroyed||!this._cb)return;this._debug("ending backpressure: bufferedAmount %d",this._channel.bufferedAmount);const e=this._cb;this._cb=null,e(null)}_onChannelOpen(){this._connected||this.destroyed||(this._debug("on channel open"),this._channelReady=!0,this._maybeReady())}_onChannelClose(){this.destroyed||(this._debug("on channel close"),this.destroy())}_onTrack(e){this.destroyed||e.streams.forEach((t=>{this._debug("on track"),this.emit("track",e.track,t),this._remoteTracks.push({track:e.track,stream:t}),this._remoteStreams.some((e=>e.id===t.id))||(this._remoteStreams.push(t),a((()=>{this._debug("on stream"),this.emit("stream",t)})))}))}_debug(){const e=[].slice.call(arguments);e[0]="["+this._id+"] "+e[0],i.apply(null,e)}}f.WEBRTC_SUPPORT=!!r(),f.config={iceServers:[{urls:["stun:stun.l.google.com:19302","stun:global.stun.twilio.com:3478"]}],sdpSemantics:"unified-plan"},f.channelConfig={},t.exports=f},{buffer:116,debug:399,"err-code":195,"get-browser-rtc":216,"queue-microtask":355,randombytes:358,"readable-stream":416}],399:[function(e,t,n){arguments[4][29][0].apply(n,arguments)},{"./common":400,_process:342,dup:29}],400:[function(e,t,n){arguments[4][30][0].apply(n,arguments)},{dup:30,ms:401}],401:[function(e,t,n){arguments[4][31][0].apply(n,arguments)},{dup:31}],402:[function(e,t,n){arguments[4][32][0].apply(n,arguments)},{dup:32}],403:[function(e,t,n){arguments[4][33][0].apply(n,arguments)},{"./_stream_readable":405,"./_stream_writable":407,_process:342,dup:33,inherits:249}],404:[function(e,t,n){arguments[4][34][0].apply(n,arguments)},{"./_stream_transform":406,dup:34,inherits:249}],405:[function(e,t,n){arguments[4][35][0].apply(n,arguments)},{"../errors":402,"./_stream_duplex":403,"./internal/streams/async_iterator":408,"./internal/streams/buffer_list":409,"./internal/streams/destroy":410,"./internal/streams/from":412,"./internal/streams/state":414,"./internal/streams/stream":415,_process:342,buffer:116,dup:35,events:196,inherits:249,"string_decoder/":481,util:73}],406:[function(e,t,n){arguments[4][36][0].apply(n,arguments)},{"../errors":402,"./_stream_duplex":403,dup:36,inherits:249}],407:[function(e,t,n){arguments[4][37][0].apply(n,arguments)},{"../errors":402,"./_stream_duplex":403,"./internal/streams/destroy":410,"./internal/streams/state":414,"./internal/streams/stream":415,_process:342,buffer:116,dup:37,inherits:249,"util-deprecate":500}],408:[function(e,t,n){arguments[4][38][0].apply(n,arguments)},{"./end-of-stream":411,_process:342,dup:38}],409:[function(e,t,n){arguments[4][39][0].apply(n,arguments)},{buffer:116,dup:39,util:73}],410:[function(e,t,n){arguments[4][40][0].apply(n,arguments)},{_process:342,dup:40}],411:[function(e,t,n){arguments[4][41][0].apply(n,arguments)},{"../../../errors":402,dup:41}],412:[function(e,t,n){arguments[4][42][0].apply(n,arguments)},{dup:42}],413:[function(e,t,n){arguments[4][43][0].apply(n,arguments)},{"../../../errors":402,"./end-of-stream":411,dup:43}],414:[function(e,t,n){arguments[4][44][0].apply(n,arguments)},{"../../../errors":402,dup:44}],415:[function(e,t,n){arguments[4][45][0].apply(n,arguments)},{dup:45,events:196}],416:[function(e,t,n){arguments[4][46][0].apply(n,arguments)},{"./lib/_stream_duplex.js":403,"./lib/_stream_passthrough.js":404,"./lib/_stream_readable.js":405,"./lib/_stream_transform.js":406,"./lib/_stream_writable.js":407,"./lib/internal/streams/end-of-stream.js":411,"./lib/internal/streams/pipeline.js":413,dup:46}],417:[function(e,t,n){const i=e("rusha"),r=e("./rusha-worker-sha1"),s=new i,o="undefined"!=typeof window?window:self,a=o.crypto||o.msCrypto||{};let c=a.subtle||a.webkitSubtle;function u(e){return s.digest(e)}try{c.digest({name:"sha-1"},new Uint8Array).catch((function(){c=!1}))}catch(e){c=!1}t.exports=function(e,t){c?("string"==typeof e&&(e=function(e){const t=e.length,n=new Uint8Array(t);for(let i=0;i>>4).toString(16)),n.push((15&t).toString(16))}return n.join("")}(new Uint8Array(e)))}),(function(){t(u(e))}))):"undefined"!=typeof window?r(e,(function(n,i){t(n?u(e):i)})):queueMicrotask((()=>t(u(e))))},t.exports.sync=u},{"./rusha-worker-sha1":418,rusha:385}],418:[function(e,t,n){const i=e("rusha");let r,s,o;t.exports=function(e,t){r||(r=i.createWorker(),s=1,o={},r.onmessage=function(e){const t=e.data.id,n=o[t];delete o[t],null!=e.data.error?n(new Error("Rusha worker error: "+e.data.error)):n(null,e.data.hash)}),o[s]=t,r.postMessage({id:s,data:e}),s+=1}},{rusha:385}],419:[function(e,t,n){(function(n){(function(){ +const n=e("debug")("simple-peer"),r=e("get-browser-rtc"),s=e("randombytes"),a=e("readable-stream"),o=e("queue-microtask"),c=e("err-code"),{Buffer:l}=e("buffer"),u=65536;function p(e){return e.replace(/a=ice-options:trickle\s\n/g,"")}class d extends a.Duplex{constructor(e){if(super(e=Object.assign({allowHalfOpen:!1},e)),this._id=s(4).toString("hex").slice(0,7),this._debug("new peer %o",e),this.channelName=e.initiator?e.channelName||s(20).toString("hex"):null,this.initiator=e.initiator||!1,this.channelConfig=e.channelConfig||d.channelConfig,this.channelNegotiated=this.channelConfig.negotiated,this.config=Object.assign({},d.config,e.config),this.offerOptions=e.offerOptions||{},this.answerOptions=e.answerOptions||{},this.sdpTransform=e.sdpTransform||(e=>e),this.streams=e.streams||(e.stream?[e.stream]:[]),this.trickle=void 0===e.trickle||e.trickle,this.allowHalfTrickle=void 0!==e.allowHalfTrickle&&e.allowHalfTrickle,this.iceCompleteTimeout=e.iceCompleteTimeout||5e3,this.destroyed=!1,this.destroying=!1,this._connected=!1,this.remoteAddress=void 0,this.remoteFamily=void 0,this.remotePort=void 0,this.localAddress=void 0,this.localFamily=void 0,this.localPort=void 0,this._wrtc=e.wrtc&&"object"==typeof e.wrtc?e.wrtc:r(),!this._wrtc)throw"undefined"==typeof window?c(new Error("No WebRTC support: Specify `opts.wrtc` option in this environment"),"ERR_WEBRTC_SUPPORT"):c(new Error("No WebRTC support: Not a supported browser"),"ERR_WEBRTC_SUPPORT");this._pcReady=!1,this._channelReady=!1,this._iceComplete=!1,this._iceCompleteTimer=null,this._channel=null,this._pendingCandidates=[],this._isNegotiating=!1,this._firstNegotiation=!0,this._batchedNegotiation=!1,this._queuedNegotiation=!1,this._sendersAwaitingStable=[],this._senderMap=new Map,this._closingInterval=null,this._remoteTracks=[],this._remoteStreams=[],this._chunk=null,this._cb=null,this._interval=null;try{this._pc=new this._wrtc.RTCPeerConnection(this.config)}catch(e){return void this.destroy(c(e,"ERR_PC_CONSTRUCTOR"))}this._isReactNativeWebrtc="number"==typeof this._pc._peerConnectionId,this._pc.oniceconnectionstatechange=()=>{this._onIceStateChange()},this._pc.onicegatheringstatechange=()=>{this._onIceStateChange()},this._pc.onconnectionstatechange=()=>{this._onConnectionStateChange()},this._pc.onsignalingstatechange=()=>{this._onSignalingStateChange()},this._pc.onicecandidate=e=>{this._onIceCandidate(e)},"object"==typeof this._pc.peerIdentity&&this._pc.peerIdentity.catch((e=>{this.destroy(c(e,"ERR_PC_PEER_IDENTITY"))})),this.initiator||this.channelNegotiated?this._setupData({channel:this._pc.createDataChannel(this.channelName,this.channelConfig)}):this._pc.ondatachannel=e=>{this._setupData(e)},this.streams&&this.streams.forEach((e=>{this.addStream(e)})),this._pc.ontrack=e=>{this._onTrack(e)},this._debug("initial negotiation"),this._needsNegotiation(),this._onFinishBound=()=>{this._onFinish()},this.once("finish",this._onFinishBound)}get bufferSize(){return this._channel&&this._channel.bufferedAmount||0}get connected(){return this._connected&&"open"===this._channel.readyState}address(){return{port:this.localPort,family:this.localFamily,address:this.localAddress}}signal(e){if(!this.destroying){if(this.destroyed)throw c(new Error("cannot signal after peer is destroyed"),"ERR_DESTROYED");if("string"==typeof e)try{e=JSON.parse(e)}catch(t){e={}}this._debug("signal()"),e.renegotiate&&this.initiator&&(this._debug("got request to renegotiate"),this._needsNegotiation()),e.transceiverRequest&&this.initiator&&(this._debug("got request for transceiver"),this.addTransceiver(e.transceiverRequest.kind,e.transceiverRequest.init)),e.candidate&&(this._pc.remoteDescription&&this._pc.remoteDescription.type?this._addIceCandidate(e.candidate):this._pendingCandidates.push(e.candidate)),e.sdp&&this._pc.setRemoteDescription(new this._wrtc.RTCSessionDescription(e)).then((()=>{this.destroyed||(this._pendingCandidates.forEach((e=>{this._addIceCandidate(e)})),this._pendingCandidates=[],"offer"===this._pc.remoteDescription.type&&this._createAnswer())})).catch((e=>{this.destroy(c(e,"ERR_SET_REMOTE_DESCRIPTION"))})),e.sdp||e.candidate||e.renegotiate||e.transceiverRequest||this.destroy(c(new Error("signal() called with invalid signal data"),"ERR_SIGNALING"))}}_addIceCandidate(e){const t=new this._wrtc.RTCIceCandidate(e);this._pc.addIceCandidate(t).catch((e=>{var i;!t.address||t.address.endsWith(".local")?(i="Ignoring unsupported ICE candidate.",console.warn(i)):this.destroy(c(e,"ERR_ADD_ICE_CANDIDATE"))}))}send(e){if(!this.destroying){if(this.destroyed)throw c(new Error("cannot send after peer is destroyed"),"ERR_DESTROYED");this._channel.send(e)}}addTransceiver(e,t){if(!this.destroying){if(this.destroyed)throw c(new Error("cannot addTransceiver after peer is destroyed"),"ERR_DESTROYED");if(this._debug("addTransceiver()"),this.initiator)try{this._pc.addTransceiver(e,t),this._needsNegotiation()}catch(e){this.destroy(c(e,"ERR_ADD_TRANSCEIVER"))}else this.emit("signal",{type:"transceiverRequest",transceiverRequest:{kind:e,init:t}})}}addStream(e){if(!this.destroying){if(this.destroyed)throw c(new Error("cannot addStream after peer is destroyed"),"ERR_DESTROYED");this._debug("addStream()"),e.getTracks().forEach((t=>{this.addTrack(t,e)}))}}addTrack(e,t){if(this.destroying)return;if(this.destroyed)throw c(new Error("cannot addTrack after peer is destroyed"),"ERR_DESTROYED");this._debug("addTrack()");const i=this._senderMap.get(e)||new Map;let n=i.get(t);if(n)throw n.removed?c(new Error("Track has been removed. You should enable/disable tracks that you want to re-add."),"ERR_SENDER_REMOVED"):c(new Error("Track has already been added to that stream."),"ERR_SENDER_ALREADY_ADDED");n=this._pc.addTrack(e,t),i.set(t,n),this._senderMap.set(e,i),this._needsNegotiation()}replaceTrack(e,t,i){if(this.destroying)return;if(this.destroyed)throw c(new Error("cannot replaceTrack after peer is destroyed"),"ERR_DESTROYED");this._debug("replaceTrack()");const n=this._senderMap.get(e),r=n?n.get(i):null;if(!r)throw c(new Error("Cannot replace track that was never added."),"ERR_TRACK_NOT_ADDED");t&&this._senderMap.set(t,n),null!=r.replaceTrack?r.replaceTrack(t):this.destroy(c(new Error("replaceTrack is not supported in this browser"),"ERR_UNSUPPORTED_REPLACETRACK"))}removeTrack(e,t){if(this.destroying)return;if(this.destroyed)throw c(new Error("cannot removeTrack after peer is destroyed"),"ERR_DESTROYED");this._debug("removeSender()");const i=this._senderMap.get(e),n=i?i.get(t):null;if(!n)throw c(new Error("Cannot remove track that was never added."),"ERR_TRACK_NOT_ADDED");try{n.removed=!0,this._pc.removeTrack(n)}catch(e){"NS_ERROR_UNEXPECTED"===e.name?this._sendersAwaitingStable.push(n):this.destroy(c(e,"ERR_REMOVE_TRACK"))}this._needsNegotiation()}removeStream(e){if(!this.destroying){if(this.destroyed)throw c(new Error("cannot removeStream after peer is destroyed"),"ERR_DESTROYED");this._debug("removeSenders()"),e.getTracks().forEach((t=>{this.removeTrack(t,e)}))}}_needsNegotiation(){this._debug("_needsNegotiation"),this._batchedNegotiation||(this._batchedNegotiation=!0,o((()=>{this._batchedNegotiation=!1,this.initiator||!this._firstNegotiation?(this._debug("starting batched negotiation"),this.negotiate()):this._debug("non-initiator initial negotiation request discarded"),this._firstNegotiation=!1})))}negotiate(){if(!this.destroying){if(this.destroyed)throw c(new Error("cannot negotiate after peer is destroyed"),"ERR_DESTROYED");this.initiator?this._isNegotiating?(this._queuedNegotiation=!0,this._debug("already negotiating, queueing")):(this._debug("start negotiation"),setTimeout((()=>{this._createOffer()}),0)):this._isNegotiating?(this._queuedNegotiation=!0,this._debug("already negotiating, queueing")):(this._debug("requesting negotiation from initiator"),this.emit("signal",{type:"renegotiate",renegotiate:!0})),this._isNegotiating=!0}}destroy(e){this._destroy(e,(()=>{}))}_destroy(e,t){this.destroyed||this.destroying||(this.destroying=!0,this._debug("destroying (error: %s)",e&&(e.message||e)),o((()=>{if(this.destroyed=!0,this.destroying=!1,this._debug("destroy (error: %s)",e&&(e.message||e)),this.readable=this.writable=!1,this._readableState.ended||this.push(null),this._writableState.finished||this.end(),this._connected=!1,this._pcReady=!1,this._channelReady=!1,this._remoteTracks=null,this._remoteStreams=null,this._senderMap=null,clearInterval(this._closingInterval),this._closingInterval=null,clearInterval(this._interval),this._interval=null,this._chunk=null,this._cb=null,this._onFinishBound&&this.removeListener("finish",this._onFinishBound),this._onFinishBound=null,this._channel){try{this._channel.close()}catch(e){}this._channel.onmessage=null,this._channel.onopen=null,this._channel.onclose=null,this._channel.onerror=null}if(this._pc){try{this._pc.close()}catch(e){}this._pc.oniceconnectionstatechange=null,this._pc.onicegatheringstatechange=null,this._pc.onsignalingstatechange=null,this._pc.onicecandidate=null,this._pc.ontrack=null,this._pc.ondatachannel=null}this._pc=null,this._channel=null,e&&this.emit("error",e),this.emit("close"),t()})))}_setupData(e){if(!e.channel)return this.destroy(c(new Error("Data channel event is missing `channel` property"),"ERR_DATA_CHANNEL"));this._channel=e.channel,this._channel.binaryType="arraybuffer","number"==typeof this._channel.bufferedAmountLowThreshold&&(this._channel.bufferedAmountLowThreshold=u),this.channelName=this._channel.label,this._channel.onmessage=e=>{this._onChannelMessage(e)},this._channel.onbufferedamountlow=()=>{this._onChannelBufferedAmountLow()},this._channel.onopen=()=>{this._onChannelOpen()},this._channel.onclose=()=>{this._onChannelClose()},this._channel.onerror=e=>{const t=e.error instanceof Error?e.error:new Error(`Datachannel error: ${e.message} ${e.filename}:${e.lineno}:${e.colno}`);this.destroy(c(t,"ERR_DATA_CHANNEL"))};let t=!1;this._closingInterval=setInterval((()=>{this._channel&&"closing"===this._channel.readyState?(t&&this._onChannelClose(),t=!0):t=!1}),5e3)}_read(){}_write(e,t,i){if(this.destroyed)return i(c(new Error("cannot write after peer is destroyed"),"ERR_DATA_CHANNEL"));if(this._connected){try{this.send(e)}catch(e){return this.destroy(c(e,"ERR_DATA_CHANNEL"))}this._channel.bufferedAmount>u?(this._debug("start backpressure: bufferedAmount %d",this._channel.bufferedAmount),this._cb=i):i(null)}else this._debug("write before connect"),this._chunk=e,this._cb=i}_onFinish(){if(this.destroyed)return;const e=()=>{setTimeout((()=>this.destroy()),1e3)};this._connected?e():this.once("connect",e)}_startIceCompleteTimeout(){this.destroyed||this._iceCompleteTimer||(this._debug("started iceComplete timeout"),this._iceCompleteTimer=setTimeout((()=>{this._iceComplete||(this._iceComplete=!0,this._debug("iceComplete timeout completed"),this.emit("iceTimeout"),this.emit("_iceComplete"))}),this.iceCompleteTimeout))}_createOffer(){this.destroyed||this._pc.createOffer(this.offerOptions).then((e=>{if(this.destroyed)return;this.trickle||this.allowHalfTrickle||(e.sdp=p(e.sdp)),e.sdp=this.sdpTransform(e.sdp);const t=()=>{if(this.destroyed)return;const t=this._pc.localDescription||e;this._debug("signal"),this.emit("signal",{type:t.type,sdp:t.sdp})};this._pc.setLocalDescription(e).then((()=>{this._debug("createOffer success"),this.destroyed||(this.trickle||this._iceComplete?t():this.once("_iceComplete",t))})).catch((e=>{this.destroy(c(e,"ERR_SET_LOCAL_DESCRIPTION"))}))})).catch((e=>{this.destroy(c(e,"ERR_CREATE_OFFER"))}))}_requestMissingTransceivers(){this._pc.getTransceivers&&this._pc.getTransceivers().forEach((e=>{e.mid||!e.sender.track||e.requested||(e.requested=!0,this.addTransceiver(e.sender.track.kind))}))}_createAnswer(){this.destroyed||this._pc.createAnswer(this.answerOptions).then((e=>{if(this.destroyed)return;this.trickle||this.allowHalfTrickle||(e.sdp=p(e.sdp)),e.sdp=this.sdpTransform(e.sdp);const t=()=>{if(this.destroyed)return;const t=this._pc.localDescription||e;this._debug("signal"),this.emit("signal",{type:t.type,sdp:t.sdp}),this.initiator||this._requestMissingTransceivers()};this._pc.setLocalDescription(e).then((()=>{this.destroyed||(this.trickle||this._iceComplete?t():this.once("_iceComplete",t))})).catch((e=>{this.destroy(c(e,"ERR_SET_LOCAL_DESCRIPTION"))}))})).catch((e=>{this.destroy(c(e,"ERR_CREATE_ANSWER"))}))}_onConnectionStateChange(){this.destroyed||"failed"===this._pc.connectionState&&this.destroy(c(new Error("Connection failed."),"ERR_CONNECTION_FAILURE"))}_onIceStateChange(){if(this.destroyed)return;const e=this._pc.iceConnectionState,t=this._pc.iceGatheringState;this._debug("iceStateChange (connection: %s) (gathering: %s)",e,t),this.emit("iceStateChange",e,t),"connected"!==e&&"completed"!==e||(this._pcReady=!0,this._maybeReady()),"failed"===e&&this.destroy(c(new Error("Ice connection failed."),"ERR_ICE_CONNECTION_FAILURE")),"closed"===e&&this.destroy(c(new Error("Ice connection closed."),"ERR_ICE_CONNECTION_CLOSED"))}getStats(e){const t=e=>("[object Array]"===Object.prototype.toString.call(e.values)&&e.values.forEach((t=>{Object.assign(e,t)})),e);0===this._pc.getStats.length||this._isReactNativeWebrtc?this._pc.getStats().then((i=>{const n=[];i.forEach((e=>{n.push(t(e))})),e(null,n)}),(t=>e(t))):this._pc.getStats.length>0?this._pc.getStats((i=>{if(this.destroyed)return;const n=[];i.result().forEach((e=>{const i={};e.names().forEach((t=>{i[t]=e.stat(t)})),i.id=e.id,i.type=e.type,i.timestamp=e.timestamp,n.push(t(i))})),e(null,n)}),(t=>e(t))):e(null,[])}_maybeReady(){if(this._debug("maybeReady pc %s channel %s",this._pcReady,this._channelReady),this._connected||this._connecting||!this._pcReady||!this._channelReady)return;this._connecting=!0;const e=()=>{this.destroyed||this.getStats(((t,i)=>{if(this.destroyed)return;t&&(i=[]);const n={},r={},s={};let a=!1;i.forEach((e=>{"remotecandidate"!==e.type&&"remote-candidate"!==e.type||(n[e.id]=e),"localcandidate"!==e.type&&"local-candidate"!==e.type||(r[e.id]=e),"candidatepair"!==e.type&&"candidate-pair"!==e.type||(s[e.id]=e)}));const o=e=>{a=!0;let t=r[e.localCandidateId];t&&(t.ip||t.address)?(this.localAddress=t.ip||t.address,this.localPort=Number(t.port)):t&&t.ipAddress?(this.localAddress=t.ipAddress,this.localPort=Number(t.portNumber)):"string"==typeof e.googLocalAddress&&(t=e.googLocalAddress.split(":"),this.localAddress=t[0],this.localPort=Number(t[1])),this.localAddress&&(this.localFamily=this.localAddress.includes(":")?"IPv6":"IPv4");let i=n[e.remoteCandidateId];i&&(i.ip||i.address)?(this.remoteAddress=i.ip||i.address,this.remotePort=Number(i.port)):i&&i.ipAddress?(this.remoteAddress=i.ipAddress,this.remotePort=Number(i.portNumber)):"string"==typeof e.googRemoteAddress&&(i=e.googRemoteAddress.split(":"),this.remoteAddress=i[0],this.remotePort=Number(i[1])),this.remoteAddress&&(this.remoteFamily=this.remoteAddress.includes(":")?"IPv6":"IPv4"),this._debug("connect local: %s:%s remote: %s:%s",this.localAddress,this.localPort,this.remoteAddress,this.remotePort)};if(i.forEach((e=>{"transport"===e.type&&e.selectedCandidatePairId&&o(s[e.selectedCandidatePairId]),("googCandidatePair"===e.type&&"true"===e.googActiveConnection||("candidatepair"===e.type||"candidate-pair"===e.type)&&e.selected)&&o(e)})),a||Object.keys(s).length&&!Object.keys(r).length){if(this._connecting=!1,this._connected=!0,this._chunk){try{this.send(this._chunk)}catch(t){return this.destroy(c(t,"ERR_DATA_CHANNEL"))}this._chunk=null,this._debug('sent chunk from "write before connect"');const e=this._cb;this._cb=null,e(null)}"number"!=typeof this._channel.bufferedAmountLowThreshold&&(this._interval=setInterval((()=>this._onInterval()),150),this._interval.unref&&this._interval.unref()),this._debug("connect"),this.emit("connect")}else setTimeout(e,100)}))};e()}_onInterval(){!this._cb||!this._channel||this._channel.bufferedAmount>u||this._onChannelBufferedAmountLow()}_onSignalingStateChange(){this.destroyed||("stable"===this._pc.signalingState&&(this._isNegotiating=!1,this._debug("flushing sender queue",this._sendersAwaitingStable),this._sendersAwaitingStable.forEach((e=>{this._pc.removeTrack(e),this._queuedNegotiation=!0})),this._sendersAwaitingStable=[],this._queuedNegotiation?(this._debug("flushing negotiation queue"),this._queuedNegotiation=!1,this._needsNegotiation()):(this._debug("negotiated"),this.emit("negotiated"))),this._debug("signalingStateChange %s",this._pc.signalingState),this.emit("signalingStateChange",this._pc.signalingState))}_onIceCandidate(e){this.destroyed||(e.candidate&&this.trickle?this.emit("signal",{type:"candidate",candidate:{candidate:e.candidate.candidate,sdpMLineIndex:e.candidate.sdpMLineIndex,sdpMid:e.candidate.sdpMid}}):e.candidate||this._iceComplete||(this._iceComplete=!0,this.emit("_iceComplete")),e.candidate&&this._startIceCompleteTimeout())}_onChannelMessage(e){if(this.destroyed)return;let t=e.data;t instanceof ArrayBuffer&&(t=l.from(t)),this.push(t)}_onChannelBufferedAmountLow(){if(this.destroyed||!this._cb)return;this._debug("ending backpressure: bufferedAmount %d",this._channel.bufferedAmount);const e=this._cb;this._cb=null,e(null)}_onChannelOpen(){this._connected||this.destroyed||(this._debug("on channel open"),this._channelReady=!0,this._maybeReady())}_onChannelClose(){this.destroyed||(this._debug("on channel close"),this.destroy())}_onTrack(e){this.destroyed||e.streams.forEach((t=>{this._debug("on track"),this.emit("track",e.track,t),this._remoteTracks.push({track:e.track,stream:t}),this._remoteStreams.some((e=>e.id===t.id))||(this._remoteStreams.push(t),o((()=>{this._debug("on stream"),this.emit("stream",t)})))}))}_debug(){const e=[].slice.call(arguments);e[0]="["+this._id+"] "+e[0],n.apply(null,e)}}d.WEBRTC_SUPPORT=!!r(),d.config={iceServers:[{urls:["stun:stun.l.google.com:19302","stun:global.stun.twilio.com:3478"]}],sdpSemantics:"unified-plan"},d.channelConfig={},t.exports=d},{buffer:110,debug:161,"err-code":192,"get-browser-rtc":213,"queue-microtask":354,randombytes:357,"readable-stream":410}],396:[function(e,t,i){arguments[4][29][0].apply(i,arguments)},{dup:29}],397:[function(e,t,i){arguments[4][30][0].apply(i,arguments)},{"./_stream_readable":399,"./_stream_writable":401,_process:341,dup:30,inherits:246}],398:[function(e,t,i){arguments[4][31][0].apply(i,arguments)},{"./_stream_transform":400,dup:31,inherits:246}],399:[function(e,t,i){arguments[4][32][0].apply(i,arguments)},{"../errors":396,"./_stream_duplex":397,"./internal/streams/async_iterator":402,"./internal/streams/buffer_list":403,"./internal/streams/destroy":404,"./internal/streams/from":406,"./internal/streams/state":408,"./internal/streams/stream":409,_process:341,buffer:110,dup:32,events:193,inherits:246,"string_decoder/":472,util:67}],400:[function(e,t,i){arguments[4][33][0].apply(i,arguments)},{"../errors":396,"./_stream_duplex":397,dup:33,inherits:246}],401:[function(e,t,i){arguments[4][34][0].apply(i,arguments)},{"../errors":396,"./_stream_duplex":397,"./internal/streams/destroy":404,"./internal/streams/state":408,"./internal/streams/stream":409,_process:341,buffer:110,dup:34,inherits:246,"util-deprecate":485}],402:[function(e,t,i){arguments[4][35][0].apply(i,arguments)},{"./end-of-stream":405,_process:341,dup:35}],403:[function(e,t,i){arguments[4][36][0].apply(i,arguments)},{buffer:110,dup:36,util:67}],404:[function(e,t,i){arguments[4][37][0].apply(i,arguments)},{_process:341,dup:37}],405:[function(e,t,i){arguments[4][38][0].apply(i,arguments)},{"../../../errors":396,dup:38}],406:[function(e,t,i){arguments[4][39][0].apply(i,arguments)},{dup:39}],407:[function(e,t,i){arguments[4][40][0].apply(i,arguments)},{"../../../errors":396,"./end-of-stream":405,dup:40}],408:[function(e,t,i){arguments[4][41][0].apply(i,arguments)},{"../../../errors":396,dup:41}],409:[function(e,t,i){arguments[4][42][0].apply(i,arguments)},{dup:42,events:193}],410:[function(e,t,i){arguments[4][43][0].apply(i,arguments)},{"./lib/_stream_duplex.js":397,"./lib/_stream_passthrough.js":398,"./lib/_stream_readable.js":399,"./lib/_stream_transform.js":400,"./lib/_stream_writable.js":401,"./lib/internal/streams/end-of-stream.js":405,"./lib/internal/streams/pipeline.js":407,dup:43}],411:[function(e,t,i){const n=e("rusha"),r=e("./rusha-worker-sha1"),s=new n,a="undefined"!=typeof window?window:self,o=a.crypto||a.msCrypto||{};let c=o.subtle||o.webkitSubtle;function l(e){return s.digest(e)}try{c.digest({name:"sha-1"},new Uint8Array).catch((function(){c=!1}))}catch(e){c=!1}t.exports=function(e,t){c?("string"==typeof e&&(e=function(e){const t=e.length,i=new Uint8Array(t);for(let n=0;n>>4).toString(16)),i.push((15&t).toString(16))}return i.join("")}(new Uint8Array(e)))}),(function(){t(l(e))}))):"undefined"!=typeof window?r(e,(function(i,n){t(i?l(e):n)})):queueMicrotask((()=>t(l(e))))},t.exports.sync=l},{"./rusha-worker-sha1":412,rusha:382}],412:[function(e,t,i){const n=e("rusha");let r,s,a;t.exports=function(e,t){r||(r=n.createWorker(),s=1,a={},r.onmessage=function(e){const t=e.data.id,i=a[t];delete a[t],null!=e.data.error?i(new Error("Rusha worker error: "+e.data.error)):i(null,e.data.hash)}),a[s]=t,r.postMessage({id:s,data:e}),s+=1}},{rusha:382}],413:[function(e,t,i){(function(i){(function(){ /*! simple-websocket. MIT License. Feross Aboukhadijeh */ -const i=e("debug")("simple-websocket"),r=e("randombytes"),s=e("readable-stream"),o=e("queue-microtask"),a=e("ws"),c="function"!=typeof a?WebSocket:a;class u extends s.Duplex{constructor(e={}){if("string"==typeof e&&(e={url:e}),super(e=Object.assign({allowHalfOpen:!1},e)),null==e.url&&null==e.socket)throw new Error("Missing required `url` or `socket` option");if(null!=e.url&&null!=e.socket)throw new Error("Must specify either `url` or `socket` option, not both");if(this._id=r(4).toString("hex").slice(0,7),this._debug("new websocket: %o",e),this.connected=!1,this.destroyed=!1,this._chunk=null,this._cb=null,this._interval=null,e.socket)this.url=e.socket.url,this._ws=e.socket,this.connected=e.socket.readyState===c.OPEN;else{this.url=e.url;try{this._ws="function"==typeof a?new c(e.url,null,{...e,encoding:void 0}):new c(e.url)}catch(e){return void o((()=>this.destroy(e)))}}this._ws.binaryType="arraybuffer",e.socket&&this.connected?o((()=>this._handleOpen())):this._ws.onopen=()=>this._handleOpen(),this._ws.onmessage=e=>this._handleMessage(e),this._ws.onclose=()=>this._handleClose(),this._ws.onerror=e=>this._handleError(e),this._handleFinishBound=()=>this._handleFinish(),this.once("finish",this._handleFinishBound)}send(e){this._ws.send(e)}destroy(e){this._destroy(e,(()=>{}))}_destroy(e,t){if(!this.destroyed){if(this._debug("destroy (error: %s)",e&&(e.message||e)),this.readable=this.writable=!1,this._readableState.ended||this.push(null),this._writableState.finished||this.end(),this.connected=!1,this.destroyed=!0,clearInterval(this._interval),this._interval=null,this._chunk=null,this._cb=null,this._handleFinishBound&&this.removeListener("finish",this._handleFinishBound),this._handleFinishBound=null,this._ws){const t=this._ws,n=()=>{t.onclose=null};if(t.readyState===c.CLOSED)n();else try{t.onclose=n,t.close()}catch(e){n()}t.onopen=null,t.onmessage=null,t.onerror=()=>{}}this._ws=null,e&&this.emit("error",e),this.emit("close"),t()}}_read(){}_write(e,t,n){if(this.destroyed)return n(new Error("cannot write after socket is destroyed"));if(this.connected){try{this.send(e)}catch(e){return this.destroy(e)}"function"!=typeof a&&this._ws.bufferedAmount>65536?(this._debug("start backpressure: bufferedAmount %d",this._ws.bufferedAmount),this._cb=n):n(null)}else this._debug("write before connect"),this._chunk=e,this._cb=n}_handleOpen(){if(!this.connected&&!this.destroyed){if(this.connected=!0,this._chunk){try{this.send(this._chunk)}catch(e){return this.destroy(e)}this._chunk=null,this._debug('sent chunk from "write before connect"');const e=this._cb;this._cb=null,e(null)}"function"!=typeof a&&(this._interval=setInterval((()=>this._onInterval()),150),this._interval.unref&&this._interval.unref()),this._debug("connect"),this.emit("connect")}}_handleMessage(e){if(this.destroyed)return;let t=e.data;t instanceof ArrayBuffer&&(t=n.from(t)),this.push(t)}_handleClose(){this.destroyed||(this._debug("on close"),this.destroy())}_handleError(e){this.destroy(new Error(`Error connecting to ${this.url}`))}_handleFinish(){if(this.destroyed)return;const e=()=>{setTimeout((()=>this.destroy()),1e3)};this.connected?e():this.once("connect",e)}_onInterval(){if(!this._cb||!this._ws||this._ws.bufferedAmount>65536)return;this._debug("ending backpressure: bufferedAmount %d",this._ws.bufferedAmount);const e=this._cb;this._cb=null,e(null)}_debug(){const e=[].slice.call(arguments);e[0]="["+this._id+"] "+e[0],i.apply(null,e)}}u.WEBSOCKET_SUPPORT=!!c,t.exports=u}).call(this)}).call(this,e("buffer").Buffer)},{buffer:116,debug:420,"queue-microtask":355,randombytes:358,"readable-stream":437,ws:73}],420:[function(e,t,n){arguments[4][29][0].apply(n,arguments)},{"./common":421,_process:342,dup:29}],421:[function(e,t,n){arguments[4][30][0].apply(n,arguments)},{dup:30,ms:422}],422:[function(e,t,n){arguments[4][31][0].apply(n,arguments)},{dup:31}],423:[function(e,t,n){arguments[4][32][0].apply(n,arguments)},{dup:32}],424:[function(e,t,n){arguments[4][33][0].apply(n,arguments)},{"./_stream_readable":426,"./_stream_writable":428,_process:342,dup:33,inherits:249}],425:[function(e,t,n){arguments[4][34][0].apply(n,arguments)},{"./_stream_transform":427,dup:34,inherits:249}],426:[function(e,t,n){arguments[4][35][0].apply(n,arguments)},{"../errors":423,"./_stream_duplex":424,"./internal/streams/async_iterator":429,"./internal/streams/buffer_list":430,"./internal/streams/destroy":431,"./internal/streams/from":433,"./internal/streams/state":435,"./internal/streams/stream":436,_process:342,buffer:116,dup:35,events:196,inherits:249,"string_decoder/":481,util:73}],427:[function(e,t,n){arguments[4][36][0].apply(n,arguments)},{"../errors":423,"./_stream_duplex":424,dup:36,inherits:249}],428:[function(e,t,n){arguments[4][37][0].apply(n,arguments)},{"../errors":423,"./_stream_duplex":424,"./internal/streams/destroy":431,"./internal/streams/state":435,"./internal/streams/stream":436,_process:342,buffer:116,dup:37,inherits:249,"util-deprecate":500}],429:[function(e,t,n){arguments[4][38][0].apply(n,arguments)},{"./end-of-stream":432,_process:342,dup:38}],430:[function(e,t,n){arguments[4][39][0].apply(n,arguments)},{buffer:116,dup:39,util:73}],431:[function(e,t,n){arguments[4][40][0].apply(n,arguments)},{_process:342,dup:40}],432:[function(e,t,n){arguments[4][41][0].apply(n,arguments)},{"../../../errors":423,dup:41}],433:[function(e,t,n){arguments[4][42][0].apply(n,arguments)},{dup:42}],434:[function(e,t,n){arguments[4][43][0].apply(n,arguments)},{"../../../errors":423,"./end-of-stream":432,dup:43}],435:[function(e,t,n){arguments[4][44][0].apply(n,arguments)},{"../../../errors":423,dup:44}],436:[function(e,t,n){arguments[4][45][0].apply(n,arguments)},{dup:45,events:196}],437:[function(e,t,n){arguments[4][46][0].apply(n,arguments)},{"./lib/_stream_duplex.js":424,"./lib/_stream_passthrough.js":425,"./lib/_stream_readable.js":426,"./lib/_stream_transform.js":427,"./lib/_stream_writable.js":428,"./lib/internal/streams/end-of-stream.js":432,"./lib/internal/streams/pipeline.js":434,dup:46}],438:[function(e,t,n){const i=e("./lib/throttle"),r=e("./lib/throttle-group");t.exports={Throttle:i,ThrottleGroup:r}},{"./lib/throttle":440,"./lib/throttle-group":439}],439:[function(e,t,n){const{TokenBucket:i}=e("limiter"),r=e("./throttle");t.exports=class{constructor(e={}){if("object"!=typeof e)throw new Error("Options must be an object");this.throttles=[],this.setEnabled(e.enabled),this.setRate(e.rate,e.chunksize)}getEnabled(){return this._enabled}getRate(){return this.bucket.tokensPerInterval}getChunksize(){return this.chunksize}setEnabled(e=!0){if("boolean"!=typeof e)throw new Error("Enabled must be a boolean");this._enabled=e;for(const t of this.throttles)t.setEnabled(e)}setRate(e,t=null){if(!Number.isInteger(e)||e<0)throw new Error("Rate must be an integer bigger than zero");if(e=parseInt(e),t&&("number"!=typeof t||t<=0))throw new Error("Chunksize must be bigger than zero");if(t=t||Math.max(parseInt(e/10),1),t=parseInt(t),e>0&&t>e)throw new Error("Chunk size must be smaller than rate");this.bucket||(this.bucket=new i(e,e,"second",null)),this.bucket.bucketSize=e,this.bucket.tokensPerInterval=e,this.chunksize=t}setChunksize(e){if(!Number.isInteger(e)||e<=0)throw new Error("Chunk size must be an integer bigger than zero");const t=this.getRate();if(e=parseInt(e),t>0&&e>t)throw new Error("Chunk size must be smaller than rate");this.chunksize=e}throttle(e={}){if("object"!=typeof e)throw new Error("Options must be an object");return new r({...e,group:this})}destroy(){for(const e of this.throttles)e.destroy();this.throttles=[]}_addThrottle(e){if(!(e instanceof r))throw new Error("Throttle must be an instance of Throttle");this.throttles.push(e)}_removeThrottle(e){const t=this.throttles.indexOf(e);t>-1&&this.throttles.splice(t,1)}}},{"./throttle":440,limiter:254}],440:[function(e,t,n){const{EventEmitter:i}=e("events"),{Transform:r}=e("streamx"),{wait:s}=e("./utils");t.exports=class extends r{constructor(e={}){if(super(),"object"!=typeof e)throw new Error("Options must be an object");const t=Object.assign({},e);if(t.group&&!(t.group instanceof o))throw new Error("Group must be an instanece of ThrottleGroup");t.group||(t.group=new o(t)),this._setEnabled(t.enabled||t.group.enabled),this._group=t.group,this._emitter=new i,this._destroyed=!1,this._group._addThrottle(this)}getEnabled(){return this._enabled}getGroup(){return this._group}_setEnabled(e=!0){if("boolean"!=typeof e)throw new Error("Enabled must be a boolean");this._enabled=e}setEnabled(e){this._setEnabled(e),this._enabled?this._emitter.emit("enabled"):this._emitter.emit("disabled")}_transform(e,t){this._processChunk(e,t)}async _waitForTokens(e){return new Promise(((t,n)=>{let i=!1;const r=this;function s(e){if(r._emitter.removeListener("disabled",s),r._emitter.removeListener("destroyed",s),!i){if(i=!0,e)return n(e);t()}}this._emitter.once("disabled",s),this._emitter.once("destroyed",s),this._group.bucket.removeTokens(e,s)}))}_areBothEnabled(){return this._enabled&&this._group.getEnabled()}async _processChunk(e,t){if(!this._areBothEnabled())return t(null,e);let n=0,i=this._group.getChunksize(),r=e.slice(n,n+i);for(;r.length>0;){if(this._areBothEnabled())try{for(;0===this._group.getRate()&&!this._destroyed&&this._areBothEnabled();)if(await s(1e3),this._destroyed)return;if(this._areBothEnabled()&&!this._group.bucket.tryRemoveTokens(r.length)&&(await this._waitForTokens(r.length),this._destroyed))return}catch(e){return t(e)}this.push(r),n+=i,i=this._areBothEnabled()?this._group.getChunksize():e.length-n,r=e.slice(n,n+i)}return t()}destroy(...e){this._group._removeThrottle(this),this._destroyed=!0,this._emitter.emit("destroyed"),super.destroy(...e)}};const o=e("./throttle-group")},{"./throttle-group":439,"./utils":441,events:196,streamx:480}],441:[function(e,t,n){t.exports={wait:function(e){return new Promise((t=>setTimeout(t,e)))}}},{}],442:[function(e,t,n){var i,r=1,s=65535,o=function(){r=r+1&s};t.exports=function(e){i||(i=setInterval(o,250)).unref&&i.unref();var t=4*(e||5),n=[0],a=1,c=r-1&s;return function(e){var i=r-c&s;for(i>t&&(i=t),c=r;i--;)a===t&&(a=0),n[a]=n[0===a?t-1:a-1],a++;e&&(n[a-1]+=e);var o=n[a-1],u=n.lengtht._pos){var o=s.substr(t._pos);if("x-user-defined"===t._charset){for(var a=r.alloc(o.length),u=0;ut._pos&&(t.push(r.from(new Uint8Array(l.result.slice(t._pos)))),t._pos=l.result.byteLength)},l.onload=function(){e(!0),t.push(null)},l.readAsArrayBuffer(s)}t._xhr.readyState===c.DONE&&"ms-stream"!==t._mode&&(e(!0),t.push(null))}}).call(this)}).call(this,e("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},e("buffer").Buffer)},{"./capability":459,_process:342,buffer:116,inherits:249,"readable-stream":476}],462:[function(e,t,n){arguments[4][32][0].apply(n,arguments)},{dup:32}],463:[function(e,t,n){arguments[4][33][0].apply(n,arguments)},{"./_stream_readable":465,"./_stream_writable":467,_process:342,dup:33,inherits:249}],464:[function(e,t,n){arguments[4][34][0].apply(n,arguments)},{"./_stream_transform":466,dup:34,inherits:249}],465:[function(e,t,n){arguments[4][35][0].apply(n,arguments)},{"../errors":462,"./_stream_duplex":463,"./internal/streams/async_iterator":468,"./internal/streams/buffer_list":469,"./internal/streams/destroy":470,"./internal/streams/from":472,"./internal/streams/state":474,"./internal/streams/stream":475,_process:342,buffer:116,dup:35,events:196,inherits:249,"string_decoder/":481,util:73}],466:[function(e,t,n){arguments[4][36][0].apply(n,arguments)},{"../errors":462,"./_stream_duplex":463,dup:36,inherits:249}],467:[function(e,t,n){arguments[4][37][0].apply(n,arguments)},{"../errors":462,"./_stream_duplex":463,"./internal/streams/destroy":470,"./internal/streams/state":474,"./internal/streams/stream":475,_process:342,buffer:116,dup:37,inherits:249,"util-deprecate":500}],468:[function(e,t,n){arguments[4][38][0].apply(n,arguments)},{"./end-of-stream":471,_process:342,dup:38}],469:[function(e,t,n){arguments[4][39][0].apply(n,arguments)},{buffer:116,dup:39,util:73}],470:[function(e,t,n){arguments[4][40][0].apply(n,arguments)},{_process:342,dup:40}],471:[function(e,t,n){arguments[4][41][0].apply(n,arguments)},{"../../../errors":462,dup:41}],472:[function(e,t,n){arguments[4][42][0].apply(n,arguments)},{dup:42}],473:[function(e,t,n){arguments[4][43][0].apply(n,arguments)},{"../../../errors":462,"./end-of-stream":471,dup:43}],474:[function(e,t,n){arguments[4][44][0].apply(n,arguments)},{"../../../errors":462,dup:44}],475:[function(e,t,n){arguments[4][45][0].apply(n,arguments)},{dup:45,events:196}],476:[function(e,t,n){arguments[4][46][0].apply(n,arguments)},{"./lib/_stream_duplex.js":463,"./lib/_stream_passthrough.js":464,"./lib/_stream_readable.js":465,"./lib/_stream_transform.js":466,"./lib/_stream_writable.js":467,"./lib/internal/streams/end-of-stream.js":471,"./lib/internal/streams/pipeline.js":473,dup:46}],477:[function(e,t,n){ +const n=e("debug")("simple-websocket"),r=e("randombytes"),s=e("readable-stream"),a=e("queue-microtask"),o=e("ws"),c="function"!=typeof o?WebSocket:o;class l extends s.Duplex{constructor(e={}){if("string"==typeof e&&(e={url:e}),super(e=Object.assign({allowHalfOpen:!1},e)),null==e.url&&null==e.socket)throw new Error("Missing required `url` or `socket` option");if(null!=e.url&&null!=e.socket)throw new Error("Must specify either `url` or `socket` option, not both");if(this._id=r(4).toString("hex").slice(0,7),this._debug("new websocket: %o",e),this.connected=!1,this.destroyed=!1,this._chunk=null,this._cb=null,this._interval=null,e.socket)this.url=e.socket.url,this._ws=e.socket,this.connected=e.socket.readyState===c.OPEN;else{this.url=e.url;try{this._ws="function"==typeof o?new c(e.url,null,{...e,encoding:void 0}):new c(e.url)}catch(e){return void a((()=>this.destroy(e)))}}this._ws.binaryType="arraybuffer",e.socket&&this.connected?a((()=>this._handleOpen())):this._ws.onopen=()=>this._handleOpen(),this._ws.onmessage=e=>this._handleMessage(e),this._ws.onclose=()=>this._handleClose(),this._ws.onerror=e=>this._handleError(e),this._handleFinishBound=()=>this._handleFinish(),this.once("finish",this._handleFinishBound)}send(e){this._ws.send(e)}destroy(e){this._destroy(e,(()=>{}))}_destroy(e,t){if(!this.destroyed){if(this._debug("destroy (error: %s)",e&&(e.message||e)),this.readable=this.writable=!1,this._readableState.ended||this.push(null),this._writableState.finished||this.end(),this.connected=!1,this.destroyed=!0,clearInterval(this._interval),this._interval=null,this._chunk=null,this._cb=null,this._handleFinishBound&&this.removeListener("finish",this._handleFinishBound),this._handleFinishBound=null,this._ws){const t=this._ws,i=()=>{t.onclose=null};if(t.readyState===c.CLOSED)i();else try{t.onclose=i,t.close()}catch(e){i()}t.onopen=null,t.onmessage=null,t.onerror=()=>{}}this._ws=null,e&&this.emit("error",e),this.emit("close"),t()}}_read(){}_write(e,t,i){if(this.destroyed)return i(new Error("cannot write after socket is destroyed"));if(this.connected){try{this.send(e)}catch(e){return this.destroy(e)}"function"!=typeof o&&this._ws.bufferedAmount>65536?(this._debug("start backpressure: bufferedAmount %d",this._ws.bufferedAmount),this._cb=i):i(null)}else this._debug("write before connect"),this._chunk=e,this._cb=i}_handleOpen(){if(!this.connected&&!this.destroyed){if(this.connected=!0,this._chunk){try{this.send(this._chunk)}catch(e){return this.destroy(e)}this._chunk=null,this._debug('sent chunk from "write before connect"');const e=this._cb;this._cb=null,e(null)}"function"!=typeof o&&(this._interval=setInterval((()=>this._onInterval()),150),this._interval.unref&&this._interval.unref()),this._debug("connect"),this.emit("connect")}}_handleMessage(e){if(this.destroyed)return;let t=e.data;t instanceof ArrayBuffer&&(t=i.from(t)),this.push(t)}_handleClose(){this.destroyed||(this._debug("on close"),this.destroy())}_handleError(e){this.destroy(new Error(`Error connecting to ${this.url}`))}_handleFinish(){if(this.destroyed)return;const e=()=>{setTimeout((()=>this.destroy()),1e3)};this.connected?e():this.once("connect",e)}_onInterval(){if(!this._cb||!this._ws||this._ws.bufferedAmount>65536)return;this._debug("ending backpressure: bufferedAmount %d",this._ws.bufferedAmount);const e=this._cb;this._cb=null,e(null)}_debug(){const e=[].slice.call(arguments);e[0]="["+this._id+"] "+e[0],n.apply(null,e)}}l.WEBSOCKET_SUPPORT=!!c,t.exports=l}).call(this)}).call(this,e("buffer").Buffer)},{buffer:110,debug:161,"queue-microtask":354,randombytes:357,"readable-stream":428,ws:67}],414:[function(e,t,i){arguments[4][29][0].apply(i,arguments)},{dup:29}],415:[function(e,t,i){arguments[4][30][0].apply(i,arguments)},{"./_stream_readable":417,"./_stream_writable":419,_process:341,dup:30,inherits:246}],416:[function(e,t,i){arguments[4][31][0].apply(i,arguments)},{"./_stream_transform":418,dup:31,inherits:246}],417:[function(e,t,i){arguments[4][32][0].apply(i,arguments)},{"../errors":414,"./_stream_duplex":415,"./internal/streams/async_iterator":420,"./internal/streams/buffer_list":421,"./internal/streams/destroy":422,"./internal/streams/from":424,"./internal/streams/state":426,"./internal/streams/stream":427,_process:341,buffer:110,dup:32,events:193,inherits:246,"string_decoder/":472,util:67}],418:[function(e,t,i){arguments[4][33][0].apply(i,arguments)},{"../errors":414,"./_stream_duplex":415,dup:33,inherits:246}],419:[function(e,t,i){arguments[4][34][0].apply(i,arguments)},{"../errors":414,"./_stream_duplex":415,"./internal/streams/destroy":422,"./internal/streams/state":426,"./internal/streams/stream":427,_process:341,buffer:110,dup:34,inherits:246,"util-deprecate":485}],420:[function(e,t,i){arguments[4][35][0].apply(i,arguments)},{"./end-of-stream":423,_process:341,dup:35}],421:[function(e,t,i){arguments[4][36][0].apply(i,arguments)},{buffer:110,dup:36,util:67}],422:[function(e,t,i){arguments[4][37][0].apply(i,arguments)},{_process:341,dup:37}],423:[function(e,t,i){arguments[4][38][0].apply(i,arguments)},{"../../../errors":414,dup:38}],424:[function(e,t,i){arguments[4][39][0].apply(i,arguments)},{dup:39}],425:[function(e,t,i){arguments[4][40][0].apply(i,arguments)},{"../../../errors":414,"./end-of-stream":423,dup:40}],426:[function(e,t,i){arguments[4][41][0].apply(i,arguments)},{"../../../errors":414,dup:41}],427:[function(e,t,i){arguments[4][42][0].apply(i,arguments)},{dup:42,events:193}],428:[function(e,t,i){arguments[4][43][0].apply(i,arguments)},{"./lib/_stream_duplex.js":415,"./lib/_stream_passthrough.js":416,"./lib/_stream_readable.js":417,"./lib/_stream_transform.js":418,"./lib/_stream_writable.js":419,"./lib/internal/streams/end-of-stream.js":423,"./lib/internal/streams/pipeline.js":425,dup:43}],429:[function(e,t,i){const n=e("./lib/throttle"),r=e("./lib/throttle-group");t.exports={Throttle:n,ThrottleGroup:r}},{"./lib/throttle":431,"./lib/throttle-group":430}],430:[function(e,t,i){const{TokenBucket:n}=e("limiter"),r=e("./throttle");t.exports=class{constructor(e={}){if("object"!=typeof e)throw new Error("Options must be an object");this.throttles=[],this.setEnabled(e.enabled),this.setRate(e.rate,e.chunksize)}getEnabled(){return this._enabled}getRate(){return this.bucket.tokensPerInterval}getChunksize(){return this.chunksize}setEnabled(e=!0){if("boolean"!=typeof e)throw new Error("Enabled must be a boolean");this._enabled=e;for(const t of this.throttles)t.setEnabled(e)}setRate(e,t=null){if(!Number.isInteger(e)||e<0)throw new Error("Rate must be an integer bigger than zero");if(e=parseInt(e),t&&("number"!=typeof t||t<=0))throw new Error("Chunksize must be bigger than zero");if(t=t||Math.max(parseInt(e/10),1),t=parseInt(t),e>0&&t>e)throw new Error("Chunk size must be smaller than rate");this.bucket||(this.bucket=new n(e,e,"second",null)),this.bucket.bucketSize=e,this.bucket.tokensPerInterval=e,this.chunksize=t}setChunksize(e){if(!Number.isInteger(e)||e<=0)throw new Error("Chunk size must be an integer bigger than zero");const t=this.getRate();if(e=parseInt(e),t>0&&e>t)throw new Error("Chunk size must be smaller than rate");this.chunksize=e}throttle(e={}){if("object"!=typeof e)throw new Error("Options must be an object");return new r({...e,group:this})}destroy(){for(const e of this.throttles)e.destroy();this.throttles=[]}_addThrottle(e){if(!(e instanceof r))throw new Error("Throttle must be an instance of Throttle");this.throttles.push(e)}_removeThrottle(e){const t=this.throttles.indexOf(e);t>-1&&this.throttles.splice(t,1)}}},{"./throttle":431,limiter:251}],431:[function(e,t,i){const{EventEmitter:n}=e("events"),{Transform:r}=e("streamx"),{wait:s}=e("./utils");t.exports=class extends r{constructor(e={}){if(super(),"object"!=typeof e)throw new Error("Options must be an object");const t=Object.assign({},e);if(t.group&&!(t.group instanceof a))throw new Error("Group must be an instanece of ThrottleGroup");t.group||(t.group=new a(t)),this._setEnabled(t.enabled||t.group.enabled),this._group=t.group,this._emitter=new n,this._destroyed=!1,this._group._addThrottle(this)}getEnabled(){return this._enabled}getGroup(){return this._group}_setEnabled(e=!0){if("boolean"!=typeof e)throw new Error("Enabled must be a boolean");this._enabled=e}setEnabled(e){this._setEnabled(e),this._enabled?this._emitter.emit("enabled"):this._emitter.emit("disabled")}_transform(e,t){this._processChunk(e,t)}async _waitForTokens(e){return new Promise(((t,i)=>{let n=!1;const r=this;function s(e){if(r._emitter.removeListener("disabled",s),r._emitter.removeListener("destroyed",s),!n){if(n=!0,e)return i(e);t()}}this._emitter.once("disabled",s),this._emitter.once("destroyed",s),this._group.bucket.removeTokens(e,s)}))}_areBothEnabled(){return this._enabled&&this._group.getEnabled()}async _processChunk(e,t){if(!this._areBothEnabled())return t(null,e);let i=0,n=this._group.getChunksize(),r=e.slice(i,i+n);for(;r.length>0;){if(this._areBothEnabled())try{for(;0===this._group.getRate()&&!this._destroyed&&this._areBothEnabled();)if(await s(1e3),this._destroyed)return;if(this._areBothEnabled()&&!this._group.bucket.tryRemoveTokens(r.length)&&(await this._waitForTokens(r.length),this._destroyed))return}catch(e){return t(e)}this.push(r),i+=n,n=this._areBothEnabled()?this._group.getChunksize():e.length-i,r=e.slice(i,i+n)}return t()}destroy(...e){this._group._removeThrottle(this),this._destroyed=!0,this._emitter.emit("destroyed"),super.destroy(...e)}};const a=e("./throttle-group")},{"./throttle-group":430,"./utils":432,events:193,streamx:471}],432:[function(e,t,i){t.exports={wait:function(e){return new Promise((t=>setTimeout(t,e)))}}},{}],433:[function(e,t,i){var n,r=1,s=65535,a=function(){r=r+1&s};t.exports=function(e){n||(n=setInterval(a,250)).unref&&n.unref();var t=4*(e||5),i=[0],o=1,c=r-1&s;return function(e){var n=r-c&s;for(n>t&&(n=t),c=r;n--;)o===t&&(o=0),i[o]=i[0===o?t-1:o-1],o++;e&&(i[o-1]+=e);var a=i[o-1],l=i.lengtht._pos){var a=s.substr(t._pos);if("x-user-defined"===t._charset){for(var o=r.alloc(a.length),l=0;lt._pos&&(t.push(r.from(new Uint8Array(u.result.slice(t._pos)))),t._pos=u.result.byteLength)},u.onload=function(){e(!0),t.push(null)},u.readAsArrayBuffer(s)}t._xhr.readyState===c.DONE&&"ms-stream"!==t._mode&&(e(!0),t.push(null))}}).call(this)}).call(this,e("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},e("buffer").Buffer)},{"./capability":450,_process:341,buffer:110,inherits:246,"readable-stream":467}],453:[function(e,t,i){arguments[4][29][0].apply(i,arguments)},{dup:29}],454:[function(e,t,i){arguments[4][30][0].apply(i,arguments)},{"./_stream_readable":456,"./_stream_writable":458,_process:341,dup:30,inherits:246}],455:[function(e,t,i){arguments[4][31][0].apply(i,arguments)},{"./_stream_transform":457,dup:31,inherits:246}],456:[function(e,t,i){arguments[4][32][0].apply(i,arguments)},{"../errors":453,"./_stream_duplex":454,"./internal/streams/async_iterator":459,"./internal/streams/buffer_list":460,"./internal/streams/destroy":461,"./internal/streams/from":463,"./internal/streams/state":465,"./internal/streams/stream":466,_process:341,buffer:110,dup:32,events:193,inherits:246,"string_decoder/":472,util:67}],457:[function(e,t,i){arguments[4][33][0].apply(i,arguments)},{"../errors":453,"./_stream_duplex":454,dup:33,inherits:246}],458:[function(e,t,i){arguments[4][34][0].apply(i,arguments)},{"../errors":453,"./_stream_duplex":454,"./internal/streams/destroy":461,"./internal/streams/state":465,"./internal/streams/stream":466,_process:341,buffer:110,dup:34,inherits:246,"util-deprecate":485}],459:[function(e,t,i){arguments[4][35][0].apply(i,arguments)},{"./end-of-stream":462,_process:341,dup:35}],460:[function(e,t,i){arguments[4][36][0].apply(i,arguments)},{buffer:110,dup:36,util:67}],461:[function(e,t,i){arguments[4][37][0].apply(i,arguments)},{_process:341,dup:37}],462:[function(e,t,i){arguments[4][38][0].apply(i,arguments)},{"../../../errors":453,dup:38}],463:[function(e,t,i){arguments[4][39][0].apply(i,arguments)},{dup:39}],464:[function(e,t,i){arguments[4][40][0].apply(i,arguments)},{"../../../errors":453,"./end-of-stream":462,dup:40}],465:[function(e,t,i){arguments[4][41][0].apply(i,arguments)},{"../../../errors":453,dup:41}],466:[function(e,t,i){arguments[4][42][0].apply(i,arguments)},{dup:42,events:193}],467:[function(e,t,i){arguments[4][43][0].apply(i,arguments)},{"./lib/_stream_duplex.js":454,"./lib/_stream_passthrough.js":455,"./lib/_stream_readable.js":456,"./lib/_stream_transform.js":457,"./lib/_stream_writable.js":458,"./lib/internal/streams/end-of-stream.js":462,"./lib/internal/streams/pipeline.js":464,dup:43}],468:[function(e,t,i){ /*! stream-to-blob-url. MIT License. Feross Aboukhadijeh */ -t.exports=async function(e,t){const n=await i(e,t);return URL.createObjectURL(n)};const i=e("stream-to-blob")},{"stream-to-blob":478}],478:[function(e,t,n){ +t.exports=async function(e,t){const i=await n(e,t);return URL.createObjectURL(i)};const n=e("stream-to-blob")},{"stream-to-blob":469}],469:[function(e,t,i){ /*! stream-to-blob. MIT License. Feross Aboukhadijeh */ -t.exports=function(e,t){if(null!=t&&"string"!=typeof t)throw new Error("Invalid mimetype, expected string.");return new Promise(((n,i)=>{const r=[];e.on("data",(e=>r.push(e))).once("end",(()=>{const e=null!=t?new Blob(r,{type:t}):new Blob(r);n(e)})).once("error",i)}))}},{}],479:[function(e,t,n){(function(n){(function(){ +t.exports=function(e,t){if(null!=t&&"string"!=typeof t)throw new Error("Invalid mimetype, expected string.");return new Promise(((i,n)=>{const r=[];e.on("data",(e=>r.push(e))).once("end",(()=>{const e=null!=t?new Blob(r,{type:t}):new Blob(r);i(e)})).once("error",n)}))}},{}],470:[function(e,t,i){(function(i){(function(){ /*! stream-with-known-length-to-buffer. MIT License. Feross Aboukhadijeh */ -var i=e("once");t.exports=function(e,t,r){r=i(r);var s=n.alloc(t),o=0;e.on("data",(function(e){e.copy(s,o),o+=e.length})).on("end",(function(){r(null,s)})).on("error",r)}}).call(this)}).call(this,e("buffer").Buffer)},{buffer:116,once:327}],480:[function(e,t,n){const{EventEmitter:i}=e("events"),r=new Error("Stream was destroyed"),s=new Error("Premature close"),o=e("queue-tick"),a=e("fast-fifo"),c=33554431,u=1^c,l=64,d=128,f=256,p=512,h=1024,m=2048,b=4096,g=8192,v=16392,y=384^c,_=65536,w=2<<16,x=4<<16,k=8<<16,E=16<<16,S=32<<16,M=64<<16,A=8454144,I=256<<16,T=33488895,j=33423359,C=65544,B=33488887,R=2105344,L=6|R,O=8470536,P=8404999,U=589831,q=Symbol.asyncIterator||Symbol("asyncIterator");class N{constructor(e,{highWaterMark:t=16384,map:n=null,mapWritable:i,byteLength:r,byteLengthWritable:s}={}){this.stream=e,this.queue=new a,this.highWaterMark=t,this.buffered=0,this.error=null,this.pipeline=null,this.byteLength=s||r||oe,this.map=i||n,this.afterWrite=K.bind(this),this.afterUpdateNextTick=X.bind(this)}get ended(){return 0!=(this.stream._duplexState&S)}push(e){return null!==this.map&&(e=this.map(e)),this.buffered+=this.byteLength(e),this.queue.push(e),this.buffered=e._readableState.highWaterMark}static isPaused(e){return 0==(e._duplexState&d)}[q](){const e=this;let t=null,n=null,i=null;return this.on("error",(e=>{t=e})),this.on("readable",(function(){null!==n&&s(e.read())})),this.on("close",(function(){null!==n&&s(null)})),{[q](){return this},next:()=>new Promise((function(t,r){n=t,i=r;const o=e.read();null!==o?s(o):0!=(4&e._duplexState)&&s(null)})),return:()=>o(null),throw:e=>o(e)};function s(s){null!==i&&(t?i(t):null===s&&0==(e._duplexState&g)?i(r):n({value:s,done:null===s}),i=n=null)}function o(t){return e.destroy(t),new Promise(((n,i)=>{if(4&e._duplexState)return n({value:void 0,done:!0});e.once("close",(function(){t?i(t):n({value:void 0,done:!0})}))}))}}}class ee extends Q{constructor(e){super(e),this._duplexState=1,this._writableState=new N(this,e),e&&(e.writev&&(this._writev=e.writev),e.write&&(this._write=e.write),e.final&&(this._final=e.final))}_writev(e,t){t(null)}_write(e,t){this._writableState.autoBatch(e,t)}_final(e){e(null)}write(e){return this._writableState.updateNextTick(),this._writableState.push(e)}end(e){return this._writableState.updateNextTick(),this._writableState.end(e),this}}class te extends ee{constructor(e){super(e),this._transformState=new z(this),e&&(e.transform&&(this._transform=e.transform),e.flush&&(this._flush=e.flush))}_write(e,t){this._readableState.buffered>=this._readableState.highWaterMark?this._transformState.data=e:this._transform(e,this._transformState.afterTransform)}_read(e){if(null!==this._transformState.data){const t=this._transformState.data;this._transformState.data=null,e(null),this._transform(t,this._transformState.afterTransform)}else e(null)}_transform(e,t){t(null,e)}_flush(e){e(null)}_final(e){this._transformState.afterFinal=e,this._flush(ne.bind(this))}}function ne(e,t){const n=this._transformState.afterFinal;if(e)return n(e);null!=t&&this.push(t),this.push(null),n(null)}function ie(e,...t){const n=Array.isArray(e)?[...e,...t]:[e,...t],i=n.length&&"function"==typeof n[n.length-1]?n.pop():null;if(n.length<2)throw new Error("Pipeline requires at least 2 streams");let r=n[0],o=null,a=null;for(let e=1;e1,u),r.pipe(o)),r=o;if(i){let e=!1;o.on("finish",(()=>{e=!0})),o.on("error",(e=>{a=a||e})),o.on("close",(()=>i(a||(e?null:s))))}return o;function c(e,t,n,i){e.on("error",i),e.on("close",(function(){if(t&&e._readableState&&!e._readableState.ended)return i(s);if(n&&e._writableState&&!e._writableState.ended)return i(s)}))}function u(e){if(e&&!a){a=e;for(const t of n)t.destroy(e)}}}function re(e){return!!e._readableState||!!e._writableState}function se(e){return"number"==typeof e._duplexState&&re(e)}function oe(e){return function(e){return"object"==typeof e&&null!==e&&"number"==typeof e.byteLength}(e)?e.byteLength:1024}function ae(){}function ce(){this.destroy(new Error("Stream aborted."))}t.exports={pipeline:ie,pipelinePromise:function(...e){return new Promise(((t,n)=>ie(...e,(e=>{if(e)return n(e);t()}))))},isStream:re,isStreamx:se,Stream:J,Writable:class extends J{constructor(e){super(e),this._duplexState|=8193,this._writableState=new N(this,e),e&&(e.writev&&(this._writev=e.writev),e.write&&(this._write=e.write),e.final&&(this._final=e.final))}_writev(e,t){t(null)}_write(e,t){this._writableState.autoBatch(e,t)}_final(e){e(null)}static isBackpressured(e){return 0!=(19922950&e._duplexState)}write(e){return this._writableState.updateNextTick(),this._writableState.push(e)}end(e){return this._writableState.updateNextTick(),this._writableState.end(e),this}},Readable:Q,Duplex:ee,Transform:te,PassThrough:class extends te{}}},{events:196,"fast-fifo":199,"queue-tick":356}],481:[function(e,t,n){"use strict";var i=e("safe-buffer").Buffer,r=i.isEncoding||function(e){switch((e=""+e)&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function s(e){var t;switch(this.encoding=function(e){var t=function(e){if(!e)return"utf8";for(var t;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}(e);if("string"!=typeof t&&(i.isEncoding===r||!r(e)))throw new Error("Unknown encoding: "+e);return t||e}(e),this.encoding){case"utf16le":this.text=c,this.end=u,t=4;break;case"utf8":this.fillLast=a,t=4;break;case"base64":this.text=l,this.end=d,t=3;break;default:return this.write=f,void(this.end=p)}this.lastNeed=0,this.lastTotal=0,this.lastChar=i.allocUnsafe(t)}function o(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function a(e){var t=this.lastTotal-this.lastNeed,n=function(e,t,n){if(128!=(192&t[0]))return e.lastNeed=0,"�";if(e.lastNeed>1&&t.length>1){if(128!=(192&t[1]))return e.lastNeed=1,"�";if(e.lastNeed>2&&t.length>2&&128!=(192&t[2]))return e.lastNeed=2,"�"}}(this,e);return void 0!==n?n:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,t,0,e.length),void(this.lastNeed-=e.length))}function c(e,t){if((e.length-t)%2==0){var n=e.toString("utf16le",t);if(n){var i=n.charCodeAt(n.length-1);if(i>=55296&&i<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],n.slice(0,-1)}return n}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function u(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var n=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,n)}return t}function l(e,t){var n=(e.length-t)%3;return 0===n?e.toString("base64",t):(this.lastNeed=3-n,this.lastTotal=3,1===n?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-n))}function d(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function f(e){return e.toString(this.encoding)}function p(e){return e&&e.length?this.write(e):""}n.StringDecoder=s,s.prototype.write=function(e){if(0===e.length)return"";var t,n;if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";n=this.lastNeed,this.lastNeed=0}else n=0;return n=0)return r>0&&(e.lastNeed=r-1),r;if(--i=0)return r>0&&(e.lastNeed=r-2),r;if(--i=0)return r>0&&(2===r?r=0:e.lastNeed=r-3),r;return 0}(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=n;var i=e.length-(n-this.lastNeed);return e.copy(this.lastChar,0,i),e.toString("utf8",t,i)},s.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length}},{"safe-buffer":386}],482:[function(e,t,n){var i=e("./thirty-two");n.encode=i.encode,n.decode=i.decode},{"./thirty-two":483}],483:[function(e,t,n){(function(e){(function(){"use strict";var t=[255,255,26,27,28,29,30,31,255,255,255,255,255,255,255,255,255,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,255,255,255,255,255,255,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,255,255,255,255,255];n.encode=function(t){e.isBuffer(t)||(t=new e(t));for(var n,i,r=0,s=0,o=0,a=0,c=new e(8*(n=t,i=Math.floor(n.length/5),n.length%5==0?i:i+1));r3?(a=(a=u&255>>o)<<(o=(o+5)%8)|(r+1>8-o,r++):(a=u>>8-(o+5)&31,0===(o=(o+5)%8)&&r++),c[s]="ABCDEFGHIJKLMNOPQRSTUVWXYZ234567".charCodeAt(a),s++}for(r=s;r>>(r=(r+5)%8),a[o]=i,o++,i=255&s<<8-r)}return a.slice(0,o)}}).call(this)}).call(this,e("buffer").Buffer)},{buffer:116}],484:[function(e,t,n){(function(t){(function(){ +var n=e("once");t.exports=function(e,t,r){r=n(r);var s=i.alloc(t),a=0;e.on("data",(function(e){e.copy(s,a),a+=e.length})).on("end",(function(){r(null,s)})).on("error",r)}}).call(this)}).call(this,e("buffer").Buffer)},{buffer:110,once:326}],471:[function(e,t,i){const{EventEmitter:n}=e("events"),r=new Error("Stream was destroyed"),s=new Error("Premature close"),a=e("queue-tick"),o=e("fast-fifo"),c=33554431,l=1^c,u=64,p=128,d=256,f=512,h=1024,m=2048,b=4096,v=8192,g=16392,y=384^c,_=65536,x=2<<16,w=4<<16,k=8<<16,E=16<<16,S=32<<16,M=64<<16,A=8454144,j=256<<16,I=33488895,T=33423359,C=65544,B=33488887,R=2105344,L=6|R,O=8470536,P=8404999,U=589831,q=Symbol.asyncIterator||Symbol("asyncIterator");class N{constructor(e,{highWaterMark:t=16384,map:i=null,mapWritable:n,byteLength:r,byteLengthWritable:s}={}){this.stream=e,this.queue=new o,this.highWaterMark=t,this.buffered=0,this.error=null,this.pipeline=null,this.byteLength=s||r||ae,this.map=n||i,this.afterWrite=V.bind(this),this.afterUpdateNextTick=X.bind(this)}get ended(){return 0!=(this.stream._duplexState&S)}push(e){return null!==this.map&&(e=this.map(e)),this.buffered+=this.byteLength(e),this.queue.push(e),this.buffered=e._readableState.highWaterMark}static isPaused(e){return 0==(e._duplexState&p)}[q](){const e=this;let t=null,i=null,n=null;return this.on("error",(e=>{t=e})),this.on("readable",(function(){null!==i&&s(e.read())})),this.on("close",(function(){null!==i&&s(null)})),{[q](){return this},next:()=>new Promise((function(t,r){i=t,n=r;const a=e.read();null!==a?s(a):0!=(4&e._duplexState)&&s(null)})),return:()=>a(null),throw:e=>a(e)};function s(s){null!==n&&(t?n(t):null===s&&0==(e._duplexState&v)?n(r):i({value:s,done:null===s}),n=i=null)}function a(t){return e.destroy(t),new Promise(((i,n)=>{if(4&e._duplexState)return i({value:void 0,done:!0});e.once("close",(function(){t?n(t):i({value:void 0,done:!0})}))}))}}}class ee extends Q{constructor(e){super(e),this._duplexState=1,this._writableState=new N(this,e),e&&(e.writev&&(this._writev=e.writev),e.write&&(this._write=e.write),e.final&&(this._final=e.final))}_writev(e,t){t(null)}_write(e,t){this._writableState.autoBatch(e,t)}_final(e){e(null)}write(e){return this._writableState.updateNextTick(),this._writableState.push(e)}end(e){return this._writableState.updateNextTick(),this._writableState.end(e),this}}class te extends ee{constructor(e){super(e),this._transformState=new z(this),e&&(e.transform&&(this._transform=e.transform),e.flush&&(this._flush=e.flush))}_write(e,t){this._readableState.buffered>=this._readableState.highWaterMark?this._transformState.data=e:this._transform(e,this._transformState.afterTransform)}_read(e){if(null!==this._transformState.data){const t=this._transformState.data;this._transformState.data=null,e(null),this._transform(t,this._transformState.afterTransform)}else e(null)}_transform(e,t){t(null,e)}_flush(e){e(null)}_final(e){this._transformState.afterFinal=e,this._flush(ie.bind(this))}}function ie(e,t){const i=this._transformState.afterFinal;if(e)return i(e);null!=t&&this.push(t),this.push(null),i(null)}function ne(e,...t){const i=Array.isArray(e)?[...e,...t]:[e,...t],n=i.length&&"function"==typeof i[i.length-1]?i.pop():null;if(i.length<2)throw new Error("Pipeline requires at least 2 streams");let r=i[0],a=null,o=null;for(let e=1;e1,l),r.pipe(a)),r=a;if(n){let e=!1;a.on("finish",(()=>{e=!0})),a.on("error",(e=>{o=o||e})),a.on("close",(()=>n(o||(e?null:s))))}return a;function c(e,t,i,n){e.on("error",n),e.on("close",(function(){if(t&&e._readableState&&!e._readableState.ended)return n(s);if(i&&e._writableState&&!e._writableState.ended)return n(s)}))}function l(e){if(e&&!o){o=e;for(const t of i)t.destroy(e)}}}function re(e){return!!e._readableState||!!e._writableState}function se(e){return"number"==typeof e._duplexState&&re(e)}function ae(e){return function(e){return"object"==typeof e&&null!==e&&"number"==typeof e.byteLength}(e)?e.byteLength:1024}function oe(){}function ce(){this.destroy(new Error("Stream aborted."))}t.exports={pipeline:ne,pipelinePromise:function(...e){return new Promise(((t,i)=>ne(...e,(e=>{if(e)return i(e);t()}))))},isStream:re,isStreamx:se,Stream:J,Writable:class extends J{constructor(e){super(e),this._duplexState|=8193,this._writableState=new N(this,e),e&&(e.writev&&(this._writev=e.writev),e.write&&(this._write=e.write),e.final&&(this._final=e.final))}_writev(e,t){t(null)}_write(e,t){this._writableState.autoBatch(e,t)}_final(e){e(null)}static isBackpressured(e){return 0!=(19922950&e._duplexState)}write(e){return this._writableState.updateNextTick(),this._writableState.push(e)}end(e){return this._writableState.updateNextTick(),this._writableState.end(e),this}},Readable:Q,Duplex:ee,Transform:te,PassThrough:class extends te{}}},{events:193,"fast-fifo":196,"queue-tick":355}],472:[function(e,t,i){"use strict";var n=e("safe-buffer").Buffer,r=n.isEncoding||function(e){switch((e=""+e)&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function s(e){var t;switch(this.encoding=function(e){var t=function(e){if(!e)return"utf8";for(var t;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}(e);if("string"!=typeof t&&(n.isEncoding===r||!r(e)))throw new Error("Unknown encoding: "+e);return t||e}(e),this.encoding){case"utf16le":this.text=c,this.end=l,t=4;break;case"utf8":this.fillLast=o,t=4;break;case"base64":this.text=u,this.end=p,t=3;break;default:return this.write=d,void(this.end=f)}this.lastNeed=0,this.lastTotal=0,this.lastChar=n.allocUnsafe(t)}function a(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function o(e){var t=this.lastTotal-this.lastNeed,i=function(e,t,i){if(128!=(192&t[0]))return e.lastNeed=0,"�";if(e.lastNeed>1&&t.length>1){if(128!=(192&t[1]))return e.lastNeed=1,"�";if(e.lastNeed>2&&t.length>2&&128!=(192&t[2]))return e.lastNeed=2,"�"}}(this,e);return void 0!==i?i:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,t,0,e.length),void(this.lastNeed-=e.length))}function c(e,t){if((e.length-t)%2==0){var i=e.toString("utf16le",t);if(i){var n=i.charCodeAt(i.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],i.slice(0,-1)}return i}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function l(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var i=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,i)}return t}function u(e,t){var i=(e.length-t)%3;return 0===i?e.toString("base64",t):(this.lastNeed=3-i,this.lastTotal=3,1===i?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-i))}function p(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function d(e){return e.toString(this.encoding)}function f(e){return e&&e.length?this.write(e):""}i.StringDecoder=s,s.prototype.write=function(e){if(0===e.length)return"";var t,i;if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";i=this.lastNeed,this.lastNeed=0}else i=0;return i=0)return r>0&&(e.lastNeed=r-1),r;if(--n=0)return r>0&&(e.lastNeed=r-2),r;if(--n=0)return r>0&&(2===r?r=0:e.lastNeed=r-3),r;return 0}(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=i;var n=e.length-(i-this.lastNeed);return e.copy(this.lastChar,0,n),e.toString("utf8",t,n)},s.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length}},{"safe-buffer":383}],473:[function(e,t,i){var n=e("./thirty-two");i.encode=n.encode,i.decode=n.decode},{"./thirty-two":474}],474:[function(e,t,i){(function(e){(function(){"use strict";var t=[255,255,26,27,28,29,30,31,255,255,255,255,255,255,255,255,255,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,255,255,255,255,255,255,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,255,255,255,255,255];i.encode=function(t){e.isBuffer(t)||(t=new e(t));for(var i,n,r=0,s=0,a=0,o=0,c=new e(8*(i=t,n=Math.floor(i.length/5),i.length%5==0?n:n+1));r3?(o=(o=l&255>>a)<<(a=(a+5)%8)|(r+1>8-a,r++):(o=l>>8-(a+5)&31,0===(a=(a+5)%8)&&r++),c[s]="ABCDEFGHIJKLMNOPQRSTUVWXYZ234567".charCodeAt(o),s++}for(r=s;r>>(r=(r+5)%8),o[a]=n,a++,n=255&s<<8-r)}return o.slice(0,a)}}).call(this)}).call(this,e("buffer").Buffer)},{buffer:110}],475:[function(e,t,i){(function(t){(function(){ /**! -* tippy.js v6.3.1 +* tippy.js v6.3.3 * (c) 2017-2021 atomiks * MIT License */ -"use strict";Object.defineProperty(n,"__esModule",{value:!0});var i=e("@popperjs/core"),r="tippy-content",s="tippy-backdrop",o="tippy-arrow",a="tippy-svg-arrow",c={passive:!0,capture:!0};function u(e,t,n){if(Array.isArray(e)){var i=e[t];return null==i?Array.isArray(n)?n[t]:n:i}return e}function l(e,t){var n={}.toString.call(e);return 0===n.indexOf("[object")&&n.indexOf(t+"]")>-1}function d(e,t){return"function"==typeof e?e.apply(void 0,t):e}function f(e,t){return 0===t?e:function(i){clearTimeout(n),n=setTimeout((function(){e(i)}),t)};var n}function p(e,t){var n=Object.assign({},e);return t.forEach((function(e){delete n[e]})),n}function h(e){return[].concat(e)}function m(e,t){-1===e.indexOf(t)&&e.push(t)}function b(e){return e.split("-")[0]}function g(e){return[].slice.call(e)}function v(){return document.createElement("div")}function y(e){return["Element","Fragment"].some((function(t){return l(e,t)}))}function _(e){return l(e,"MouseEvent")}function w(e){return!(!e||!e._tippy||e._tippy.reference!==e)}function x(e){return y(e)?[e]:function(e){return l(e,"NodeList")}(e)?g(e):Array.isArray(e)?e:g(document.querySelectorAll(e))}function k(e,t){e.forEach((function(e){e&&(e.style.transitionDuration=t+"ms")}))}function E(e,t){e.forEach((function(e){e&&e.setAttribute("data-state",t)}))}function S(e){var t,n=h(e)[0];return(null==n||null==(t=n.ownerDocument)?void 0:t.body)?n.ownerDocument:document}function M(e,t,n){var i=t+"EventListener";["transitionend","webkitTransitionEnd"].forEach((function(t){e[i](t,n)}))}var A={isTouch:!1},I=0;function T(){A.isTouch||(A.isTouch=!0,window.performance&&document.addEventListener("mousemove",j))}function j(){var e=performance.now();e-I<20&&(A.isTouch=!1,document.removeEventListener("mousemove",j)),I=e}function C(){var e=document.activeElement;if(w(e)){var t=e._tippy;e.blur&&!t.state.isVisible&&e.blur()}}var B,R="undefined"!=typeof window&&"undefined"!=typeof document?navigator.userAgent:"",L=/MSIE |Trident\//.test(R);function O(e){return[e+"() was called on a"+("destroy"===e?"n already-":" ")+"destroyed instance. This is a no-op but","indicates a potential memory leak."].join(" ")}function P(e){return e.replace(/[ \t]{2,}/g," ").replace(/^[ \t]*/gm,"").trim()}function U(e){return P("\n %ctippy.js\n\n %c"+P(e)+"\n\n %c👷‍ This is a development-only message. It will be removed in production.\n ")}function q(e){return[U(e),"color: #00C584; font-size: 1.3em; font-weight: bold;","line-height: 1.5","color: #a6a095;"]}function N(e,t){var n;e&&!B.has(t)&&(B.add(t),(n=console).warn.apply(n,q(t)))}function D(e,t){var n;e&&!B.has(t)&&(B.add(t),(n=console).error.apply(n,q(t)))}"production"!==t.env.NODE_ENV&&(B=new Set);var z={animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},H=Object.assign({appendTo:function(){return document.body},aria:{content:"auto",expanded:"auto"},delay:0,duration:[300,250],getReferenceClientRect:null,hideOnClick:!0,ignoreAttributes:!1,interactive:!1,interactiveBorder:2,interactiveDebounce:0,moveTransition:"",offset:[0,10],onAfterUpdate:function(){},onBeforeUpdate:function(){},onCreate:function(){},onDestroy:function(){},onHidden:function(){},onHide:function(){},onMount:function(){},onShow:function(){},onShown:function(){},onTrigger:function(){},onUntrigger:function(){},onClickOutside:function(){},placement:"top",plugins:[],popperOptions:{},render:null,showOnCreate:!1,touch:!0,trigger:"mouseenter focus",triggerTarget:null},z,{},{allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999}),F=Object.keys(H);function W(e){var t=(e.plugins||[]).reduce((function(t,n){var i=n.name,r=n.defaultValue;return i&&(t[i]=void 0!==e[i]?e[i]:r),t}),{});return Object.assign({},e,{},t)}function V(e,t){var n=Object.assign({},t,{content:d(t.content,[e])},t.ignoreAttributes?{}:function(e,t){return(t?Object.keys(W(Object.assign({},H,{plugins:t}))):F).reduce((function(t,n){var i=(e.getAttribute("data-tippy-"+n)||"").trim();if(!i)return t;if("content"===n)t[n]=i;else try{t[n]=JSON.parse(i)}catch(e){t[n]=i}return t}),{})}(e,t.plugins));return n.aria=Object.assign({},H.aria,{},n.aria),n.aria={expanded:"auto"===n.aria.expanded?t.interactive:n.aria.expanded,content:"auto"===n.aria.content?t.interactive?null:"describedby":n.aria.content},n}function K(e,t){void 0===e&&(e={}),void 0===t&&(t=[]),Object.keys(e).forEach((function(e){var n,i,r=p(H,Object.keys(z)),s=(n=r,i=e,!{}.hasOwnProperty.call(n,i));s&&(s=0===t.filter((function(t){return t.name===e})).length),N(s,["`"+e+"`","is not a valid prop. You may have spelled it incorrectly, or if it's","a plugin, forgot to pass it in an array as props.plugins.","\n\n","All props: https://atomiks.github.io/tippyjs/v6/all-props/\n","Plugins: https://atomiks.github.io/tippyjs/v6/plugins/"].join(" "))}))}function $(e,t){e.innerHTML=t}function G(e){var t=v();return!0===e?t.className=o:(t.className=a,y(e)?t.appendChild(e):$(t,e)),t}function X(e,t){y(t.content)?($(e,""),e.appendChild(t.content)):"function"!=typeof t.content&&(t.allowHTML?$(e,t.content):e.textContent=t.content)}function Y(e){var t=e.firstElementChild,n=g(t.children);return{box:t,content:n.find((function(e){return e.classList.contains(r)})),arrow:n.find((function(e){return e.classList.contains(o)||e.classList.contains(a)})),backdrop:n.find((function(e){return e.classList.contains(s)}))}}function Z(e){var t=v(),n=v();n.className="tippy-box",n.setAttribute("data-state","hidden"),n.setAttribute("tabindex","-1");var i=v();function s(n,i){var r=Y(t),s=r.box,o=r.content,a=r.arrow;i.theme?s.setAttribute("data-theme",i.theme):s.removeAttribute("data-theme"),"string"==typeof i.animation?s.setAttribute("data-animation",i.animation):s.removeAttribute("data-animation"),i.inertia?s.setAttribute("data-inertia",""):s.removeAttribute("data-inertia"),s.style.maxWidth="number"==typeof i.maxWidth?i.maxWidth+"px":i.maxWidth,i.role?s.setAttribute("role",i.role):s.removeAttribute("role"),n.content===i.content&&n.allowHTML===i.allowHTML||X(o,e.props),i.arrow?a?n.arrow!==i.arrow&&(s.removeChild(a),s.appendChild(G(i.arrow))):s.appendChild(G(i.arrow)):a&&s.removeChild(a)}return i.className=r,i.setAttribute("data-state","hidden"),X(i,e.props),t.appendChild(n),n.appendChild(i),s(e.props,e.props),{popper:t,onUpdate:s}}Z.$$tippy=!0;var J=1,Q=[],ee=[];function te(e,n){var r,s,o,a,l,p,y,w,x,I=V(e,Object.assign({},H,{},W((r=n,Object.keys(r).reduce((function(e,t){return void 0!==r[t]&&(e[t]=r[t]),e}),{}))))),T=!1,j=!1,C=!1,B=!1,R=[],P=f(xe,I.interactiveDebounce),U=J++,q=(x=I.plugins).filter((function(e,t){return x.indexOf(e)===t})),z={id:U,reference:e,popper:v(),popperInstance:null,props:I,state:{isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},plugins:q,clearDelayTimeouts:function(){clearTimeout(s),clearTimeout(o),cancelAnimationFrame(a)},setProps:function(n){"production"!==t.env.NODE_ENV&&N(z.state.isDestroyed,O("setProps"));if(z.state.isDestroyed)return;ce("onBeforeUpdate",[z,n]),_e();var i=z.props,r=V(e,Object.assign({},z.props,{},n,{ignoreAttributes:!0}));z.props=r,ye(),i.interactiveDebounce!==r.interactiveDebounce&&(de(),P=f(xe,r.interactiveDebounce));i.triggerTarget&&!r.triggerTarget?h(i.triggerTarget).forEach((function(e){e.removeAttribute("aria-expanded")})):r.triggerTarget&&e.removeAttribute("aria-expanded");le(),ae(),$&&$(i,r);z.popperInstance&&(Me(),Ie().forEach((function(e){requestAnimationFrame(e._tippy.popperInstance.forceUpdate)})));ce("onAfterUpdate",[z,n])},setContent:function(e){z.setProps({content:e})},show:function(){"production"!==t.env.NODE_ENV&&N(z.state.isDestroyed,O("show"));var e=z.state.isVisible,n=z.state.isDestroyed,i=!z.state.isEnabled,r=A.isTouch&&!z.props.touch,s=u(z.props.duration,0,H.duration);if(e||n||i||r)return;if(ie().hasAttribute("disabled"))return;if(ce("onShow",[z],!1),!1===z.props.onShow(z))return;z.state.isVisible=!0,ne()&&(K.style.visibility="visible");ae(),me(),z.state.isMounted||(K.style.transition="none");if(ne()){var o=se(),a=o.box,c=o.content;k([a,c],0)}y=function(){var e;if(z.state.isVisible&&!B){if(B=!0,K.offsetHeight,K.style.transition=z.props.moveTransition,ne()&&z.props.animation){var t=se(),n=t.box,i=t.content;k([n,i],s),E([n,i],"visible")}ue(),le(),m(ee,z),null==(e=z.popperInstance)||e.forceUpdate(),z.state.isMounted=!0,ce("onMount",[z]),z.props.animation&&ne()&&function(e,t){ge(e,t)}(s,(function(){z.state.isShown=!0,ce("onShown",[z])}))}},function(){var e,n=z.props.appendTo,i=ie();e=z.props.interactive&&n===H.appendTo||"parent"===n?i.parentNode:d(n,[i]);e.contains(K)||e.appendChild(K);Me(),"production"!==t.env.NODE_ENV&&N(z.props.interactive&&n===H.appendTo&&i.nextElementSibling!==K,["Interactive tippy element may not be accessible via keyboard","navigation because it is not directly after the reference element","in the DOM source order.","\n\n","Using a wrapper
or tag around the reference element","solves this by creating a new parentNode context.","\n\n","Specifying `appendTo: document.body` silences this warning, but it","assumes you are using a focus management solution to handle","keyboard navigation.","\n\n","See: https://atomiks.github.io/tippyjs/v6/accessibility/#interactivity"].join(" "))}()},hide:function(){"production"!==t.env.NODE_ENV&&N(z.state.isDestroyed,O("hide"));var e=!z.state.isVisible,n=z.state.isDestroyed,i=!z.state.isEnabled,r=u(z.props.duration,1,H.duration);if(e||n||i)return;if(ce("onHide",[z],!1),!1===z.props.onHide(z))return;z.state.isVisible=!1,z.state.isShown=!1,B=!1,T=!1,ne()&&(K.style.visibility="hidden");if(de(),be(),ae(),ne()){var s=se(),o=s.box,a=s.content;z.props.animation&&(k([o,a],r),E([o,a],"hidden"))}ue(),le(),z.props.animation?ne()&&function(e,t){ge(e,(function(){!z.state.isVisible&&K.parentNode&&K.parentNode.contains(K)&&t()}))}(r,z.unmount):z.unmount()},hideWithInteractivity:function(e){"production"!==t.env.NODE_ENV&&N(z.state.isDestroyed,O("hideWithInteractivity"));re().addEventListener("mousemove",P),m(Q,P),P(e)},enable:function(){z.state.isEnabled=!0},disable:function(){z.hide(),z.state.isEnabled=!1},unmount:function(){"production"!==t.env.NODE_ENV&&N(z.state.isDestroyed,O("unmount"));z.state.isVisible&&z.hide();if(!z.state.isMounted)return;Ae(),Ie().forEach((function(e){e._tippy.unmount()})),K.parentNode&&K.parentNode.removeChild(K);ee=ee.filter((function(e){return e!==z})),z.state.isMounted=!1,ce("onHidden",[z])},destroy:function(){"production"!==t.env.NODE_ENV&&N(z.state.isDestroyed,O("destroy"));if(z.state.isDestroyed)return;z.clearDelayTimeouts(),z.unmount(),_e(),delete e._tippy,z.state.isDestroyed=!0,ce("onDestroy",[z])}};if(!I.render)return"production"!==t.env.NODE_ENV&&D(!0,"render() function has not been supplied."),z;var F=I.render(z),K=F.popper,$=F.onUpdate;K.setAttribute("data-tippy-root",""),K.id="tippy-"+z.id,z.popper=K,e._tippy=z,K._tippy=z;var G=q.map((function(e){return e.fn(z)})),X=e.hasAttribute("aria-expanded");return ye(),le(),ae(),ce("onCreate",[z]),I.showOnCreate&&Te(),K.addEventListener("mouseenter",(function(){z.props.interactive&&z.state.isVisible&&z.clearDelayTimeouts()})),K.addEventListener("mouseleave",(function(e){z.props.interactive&&z.props.trigger.indexOf("mouseenter")>=0&&(re().addEventListener("mousemove",P),P(e))})),z;function Z(){var e=z.props.touch;return Array.isArray(e)?e:[e,0]}function te(){return"hold"===Z()[0]}function ne(){var e;return!!(null==(e=z.props.render)?void 0:e.$$tippy)}function ie(){return w||e}function re(){var e=ie().parentNode;return e?S(e):document}function se(){return Y(K)}function oe(e){return z.state.isMounted&&!z.state.isVisible||A.isTouch||l&&"focus"===l.type?0:u(z.props.delay,e?0:1,H.delay)}function ae(){K.style.pointerEvents=z.props.interactive&&z.state.isVisible?"":"none",K.style.zIndex=""+z.props.zIndex}function ce(e,t,n){var i;(void 0===n&&(n=!0),G.forEach((function(n){n[e]&&n[e].apply(void 0,t)})),n)&&(i=z.props)[e].apply(i,t)}function ue(){var t=z.props.aria;if(t.content){var n="aria-"+t.content,i=K.id;h(z.props.triggerTarget||e).forEach((function(e){var t=e.getAttribute(n);if(z.state.isVisible)e.setAttribute(n,t?t+" "+i:i);else{var r=t&&t.replace(i,"").trim();r?e.setAttribute(n,r):e.removeAttribute(n)}}))}}function le(){!X&&z.props.aria.expanded&&h(z.props.triggerTarget||e).forEach((function(e){z.props.interactive?e.setAttribute("aria-expanded",z.state.isVisible&&e===ie()?"true":"false"):e.removeAttribute("aria-expanded")}))}function de(){re().removeEventListener("mousemove",P),Q=Q.filter((function(e){return e!==P}))}function fe(e){if(!(A.isTouch&&(C||"mousedown"===e.type)||z.props.interactive&&K.contains(e.target))){if(ie().contains(e.target)){if(A.isTouch)return;if(z.state.isVisible&&z.props.trigger.indexOf("click")>=0)return}else ce("onClickOutside",[z,e]);!0===z.props.hideOnClick&&(z.clearDelayTimeouts(),z.hide(),j=!0,setTimeout((function(){j=!1})),z.state.isMounted||be())}}function pe(){C=!0}function he(){C=!1}function me(){var e=re();e.addEventListener("mousedown",fe,!0),e.addEventListener("touchend",fe,c),e.addEventListener("touchstart",he,c),e.addEventListener("touchmove",pe,c)}function be(){var e=re();e.removeEventListener("mousedown",fe,!0),e.removeEventListener("touchend",fe,c),e.removeEventListener("touchstart",he,c),e.removeEventListener("touchmove",pe,c)}function ge(e,t){var n=se().box;function i(e){e.target===n&&(M(n,"remove",i),t())}if(0===e)return t();M(n,"remove",p),M(n,"add",i),p=i}function ve(t,n,i){void 0===i&&(i=!1),h(z.props.triggerTarget||e).forEach((function(e){e.addEventListener(t,n,i),R.push({node:e,eventType:t,handler:n,options:i})}))}function ye(){var e;te()&&(ve("touchstart",we,{passive:!0}),ve("touchend",ke,{passive:!0})),(e=z.props.trigger,e.split(/\s+/).filter(Boolean)).forEach((function(e){if("manual"!==e)switch(ve(e,we),e){case"mouseenter":ve("mouseleave",ke);break;case"focus":ve(L?"focusout":"blur",Ee);break;case"focusin":ve("focusout",Ee)}}))}function _e(){R.forEach((function(e){var t=e.node,n=e.eventType,i=e.handler,r=e.options;t.removeEventListener(n,i,r)})),R=[]}function we(e){var t,n=!1;if(z.state.isEnabled&&!Se(e)&&!j){var i="focus"===(null==(t=l)?void 0:t.type);l=e,w=e.currentTarget,le(),!z.state.isVisible&&_(e)&&Q.forEach((function(t){return t(e)})),"click"===e.type&&(z.props.trigger.indexOf("mouseenter")<0||T)&&!1!==z.props.hideOnClick&&z.state.isVisible?n=!0:Te(e),"click"===e.type&&(T=!n),n&&!i&&je(e)}}function xe(e){var t=e.target,n=ie().contains(t)||K.contains(t);"mousemove"===e.type&&n||function(e,t){var n=t.clientX,i=t.clientY;return e.every((function(e){var t=e.popperRect,r=e.popperState,s=e.props.interactiveBorder,o=b(r.placement),a=r.modifiersData.offset;if(!a)return!0;var c="bottom"===o?a.top.y:0,u="top"===o?a.bottom.y:0,l="right"===o?a.left.x:0,d="left"===o?a.right.x:0,f=t.top-i+c>s,p=i-t.bottom-u>s,h=t.left-n+l>s,m=n-t.right-d>s;return f||p||h||m}))}(Ie().concat(K).map((function(e){var t,n=null==(t=e._tippy.popperInstance)?void 0:t.state;return n?{popperRect:e.getBoundingClientRect(),popperState:n,props:I}:null})).filter(Boolean),e)&&(de(),je(e))}function ke(e){Se(e)||z.props.trigger.indexOf("click")>=0&&T||(z.props.interactive?z.hideWithInteractivity(e):je(e))}function Ee(e){z.props.trigger.indexOf("focusin")<0&&e.target!==ie()||z.props.interactive&&e.relatedTarget&&K.contains(e.relatedTarget)||je(e)}function Se(e){return!!A.isTouch&&te()!==e.type.indexOf("touch")>=0}function Me(){Ae();var t=z.props,n=t.popperOptions,r=t.placement,s=t.offset,o=t.getReferenceClientRect,a=t.moveTransition,c=ne()?Y(K).arrow:null,u=o?{getBoundingClientRect:o,contextElement:o.contextElement||ie()}:e,l=[{name:"offset",options:{offset:s}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!a}},{name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(e){var t=e.state;if(ne()){var n=se().box;["placement","reference-hidden","escaped"].forEach((function(e){"placement"===e?n.setAttribute("data-placement",t.placement):t.attributes.popper["data-popper-"+e]?n.setAttribute("data-"+e,""):n.removeAttribute("data-"+e)})),t.attributes.popper={}}}}];ne()&&c&&l.push({name:"arrow",options:{element:c,padding:3}}),l.push.apply(l,(null==n?void 0:n.modifiers)||[]),z.popperInstance=i.createPopper(u,K,Object.assign({},n,{placement:r,onFirstUpdate:y,modifiers:l}))}function Ae(){z.popperInstance&&(z.popperInstance.destroy(),z.popperInstance=null)}function Ie(){return g(K.querySelectorAll("[data-tippy-root]"))}function Te(e){z.clearDelayTimeouts(),e&&ce("onTrigger",[z,e]),me();var t=oe(!0),n=Z(),i=n[0],r=n[1];A.isTouch&&"hold"===i&&r&&(t=r),t?s=setTimeout((function(){z.show()}),t):z.show()}function je(e){if(z.clearDelayTimeouts(),ce("onUntrigger",[z,e]),z.state.isVisible){if(!(z.props.trigger.indexOf("mouseenter")>=0&&z.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(e.type)>=0&&T)){var t=oe(!1);t?o=setTimeout((function(){z.state.isVisible&&z.hide()}),t):a=requestAnimationFrame((function(){z.hide()}))}}else be()}}function ne(e,n){void 0===n&&(n={});var i=H.plugins.concat(n.plugins||[]);"production"!==t.env.NODE_ENV&&(!function(e){var t=!e,n="[object Object]"===Object.prototype.toString.call(e)&&!e.addEventListener;D(t,["tippy() was passed","`"+String(e)+"`","as its targets (first) argument. Valid types are: String, Element,","Element[], or NodeList."].join(" ")),D(n,["tippy() was passed a plain object which is not supported as an argument","for virtual positioning. Use props.getReferenceClientRect instead."].join(" "))}(e),K(n,i)),document.addEventListener("touchstart",T,c),window.addEventListener("blur",C);var r=Object.assign({},n,{plugins:i}),s=x(e);if("production"!==t.env.NODE_ENV){var o=y(r.content),a=s.length>1;N(o&&a,["tippy() was passed an Element as the `content` prop, but more than","one tippy instance was created by this invocation. This means the","content element will only be appended to the last tippy instance.","\n\n","Instead, pass the .innerHTML of the element, or use a function that","returns a cloned version of the element instead.","\n\n","1) content: element.innerHTML\n","2) content: () => element.cloneNode(true)"].join(" "))}var u=s.reduce((function(e,t){var n=t&&te(t,r);return n&&e.push(n),e}),[]);return y(e)?u[0]:u}ne.defaultProps=H,ne.setDefaultProps=function(e){"production"!==t.env.NODE_ENV&&K(e,[]),Object.keys(e).forEach((function(t){H[t]=e[t]}))},ne.currentInput=A;var ie=Object.assign({},i.applyStyles,{effect:function(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow)}}),re={mouseover:"mouseenter",focusin:"focus",click:"click"};var se={name:"animateFill",defaultValue:!1,fn:function(e){var n;if(!(null==(n=e.props.render)?void 0:n.$$tippy))return"production"!==t.env.NODE_ENV&&D(e.props.animateFill,"The `animateFill` plugin requires the default render function."),{};var i=Y(e.popper),r=i.box,o=i.content,a=e.props.animateFill?function(){var e=v();return e.className=s,E([e],"hidden"),e}():null;return{onCreate:function(){a&&(r.insertBefore(a,r.firstElementChild),r.setAttribute("data-animatefill",""),r.style.overflow="hidden",e.setProps({arrow:!1,animation:"shift-away"}))},onMount:function(){if(a){var e=r.style.transitionDuration,t=Number(e.replace("ms",""));o.style.transitionDelay=Math.round(t/10)+"ms",a.style.transitionDuration=e,E([a],"visible")}},onShow:function(){a&&(a.style.transitionDuration="0ms")},onHide:function(){a&&E([a],"hidden")}}}};var oe={clientX:0,clientY:0},ae=[];function ce(e){var t=e.clientX,n=e.clientY;oe={clientX:t,clientY:n}}var ue={name:"followCursor",defaultValue:!1,fn:function(e){var t=e.reference,n=S(e.props.triggerTarget||t),i=!1,r=!1,s=!0,o=e.props;function a(){return"initial"===e.props.followCursor&&e.state.isVisible}function c(){n.addEventListener("mousemove",d)}function u(){n.removeEventListener("mousemove",d)}function l(){i=!0,e.setProps({getReferenceClientRect:null}),i=!1}function d(n){var i=!n.target||t.contains(n.target),r=e.props.followCursor,s=n.clientX,o=n.clientY,a=t.getBoundingClientRect(),c=s-a.left,u=o-a.top;!i&&e.props.interactive||e.setProps({getReferenceClientRect:function(){var e=t.getBoundingClientRect(),n=s,i=o;"initial"===r&&(n=e.left+c,i=e.top+u);var a="horizontal"===r?e.top:i,l="vertical"===r?e.right:n,d="horizontal"===r?e.bottom:i,f="vertical"===r?e.left:n;return{width:l-f,height:d-a,top:a,right:l,bottom:d,left:f}}})}function f(){e.props.followCursor&&(ae.push({instance:e,doc:n}),function(e){e.addEventListener("mousemove",ce)}(n))}function p(){0===(ae=ae.filter((function(t){return t.instance!==e}))).filter((function(e){return e.doc===n})).length&&function(e){e.removeEventListener("mousemove",ce)}(n)}return{onCreate:f,onDestroy:p,onBeforeUpdate:function(){o=e.props},onAfterUpdate:function(t,n){var s=n.followCursor;i||void 0!==s&&o.followCursor!==s&&(p(),s?(f(),!e.state.isMounted||r||a()||c()):(u(),l()))},onMount:function(){e.props.followCursor&&!r&&(s&&(d(oe),s=!1),a()||c())},onTrigger:function(e,t){_(t)&&(oe={clientX:t.clientX,clientY:t.clientY}),r="focus"===t.type},onHidden:function(){e.props.followCursor&&(l(),u(),s=!0)}}}};var le={name:"inlinePositioning",defaultValue:!1,fn:function(e){var t,n=e.reference;var i=-1,r=!1,s={name:"tippyInlinePositioning",enabled:!0,phase:"afterWrite",fn:function(r){var s=r.state;e.props.inlinePositioning&&(t!==s.placement&&e.setProps({getReferenceClientRect:function(){return function(e){return function(e,t,n,i){if(n.length<2||null===e)return t;if(2===n.length&&i>=0&&n[0].left>n[1].right)return n[i]||t;switch(e){case"top":case"bottom":var r=n[0],s=n[n.length-1],o="top"===e,a=r.top,c=s.bottom,u=o?r.left:s.left,l=o?r.right:s.right;return{top:a,bottom:c,left:u,right:l,width:l-u,height:c-a};case"left":case"right":var d=Math.min.apply(Math,n.map((function(e){return e.left}))),f=Math.max.apply(Math,n.map((function(e){return e.right}))),p=n.filter((function(t){return"left"===e?t.left===d:t.right===f})),h=p[0].top,m=p[p.length-1].bottom;return{top:h,bottom:m,left:d,right:f,width:f-d,height:m-h};default:return t}}(b(e),n.getBoundingClientRect(),g(n.getClientRects()),i)}(s.placement)}}),t=s.placement)}};function o(){var t;r||(t=function(e,t){var n;return{popperOptions:Object.assign({},e.popperOptions,{modifiers:[].concat(((null==(n=e.popperOptions)?void 0:n.modifiers)||[]).filter((function(e){return e.name!==t.name})),[t])})}}(e.props,s),r=!0,e.setProps(t),r=!1)}return{onCreate:o,onAfterUpdate:o,onTrigger:function(t,n){if(_(n)){var r=g(e.reference.getClientRects()),s=r.find((function(e){return e.left-2<=n.clientX&&e.right+2>=n.clientX&&e.top-2<=n.clientY&&e.bottom+2>=n.clientY}));i=r.indexOf(s)}},onUntrigger:function(){i=-1}}}};var de={name:"sticky",defaultValue:!1,fn:function(e){var t=e.reference,n=e.popper;function i(t){return!0===e.props.sticky||e.props.sticky===t}var r=null,s=null;function o(){var a=i("reference")?(e.popperInstance?e.popperInstance.state.elements.reference:t).getBoundingClientRect():null,c=i("popper")?n.getBoundingClientRect():null;(a&&fe(r,a)||c&&fe(s,c))&&e.popperInstance&&e.popperInstance.update(),r=a,s=c,e.state.isMounted&&requestAnimationFrame(o)}return{onMount:function(){e.props.sticky&&o()}}}};function fe(e,t){return!e||!t||(e.top!==t.top||e.right!==t.right||e.bottom!==t.bottom||e.left!==t.left)}ne.setDefaultProps({render:Z}),n.animateFill=se,n.createSingleton=function(e,n){var i;void 0===n&&(n={}),"production"!==t.env.NODE_ENV&&D(!Array.isArray(e),["The first argument passed to createSingleton() must be an array of","tippy instances. The passed value was",String(e)].join(" "));var r,s=e,o=[],a=n.overrides,c=[],u=!1;function l(){o=s.map((function(e){return e.reference}))}function d(e){s.forEach((function(t){e?t.enable():t.disable()}))}function f(e){return s.map((function(t){var n=t.setProps;return t.setProps=function(i){n(i),t.reference===r&&e.setProps(i)},function(){t.setProps=n}}))}function h(e,t){var n=o.indexOf(t);if(t!==r){r=t;var i=(a||[]).concat("content").reduce((function(e,t){return e[t]=s[n].props[t],e}),{});e.setProps(Object.assign({},i,{getReferenceClientRect:"function"==typeof i.getReferenceClientRect?i.getReferenceClientRect:function(){return t.getBoundingClientRect()}}))}}d(!1),l();var m={fn:function(){return{onDestroy:function(){d(!0)},onHidden:function(){r=null},onClickOutside:function(e){e.props.showOnCreate&&!u&&(u=!0,r=null)},onShow:function(e){e.props.showOnCreate&&!u&&(u=!0,h(e,o[0]))},onTrigger:function(e,t){h(e,t.currentTarget)}}}},b=ne(v(),Object.assign({},p(n,["overrides"]),{plugins:[m].concat(n.plugins||[]),triggerTarget:o,popperOptions:Object.assign({},n.popperOptions,{modifiers:[].concat((null==(i=n.popperOptions)?void 0:i.modifiers)||[],[ie])})})),g=b.show;b.show=function(e){if(g(),!r&&null==e)return h(b,o[0]);if(!r||null!=e){if("number"==typeof e)return o[e]&&h(b,o[e]);if(s.includes(e)){var t=e.reference;return h(b,t)}return o.includes(e)?h(b,e):void 0}},b.showNext=function(){var e=o[0];if(!r)return b.show(0);var t=o.indexOf(r);b.show(o[t+1]||e)},b.showPrevious=function(){var e=o[o.length-1];if(!r)return b.show(e);var t=o.indexOf(r),n=o[t-1]||e;b.show(n)};var y=b.setProps;return b.setProps=function(e){a=e.overrides||a,y(e)},b.setInstances=function(e){d(!0),c.forEach((function(e){return e()})),s=e,d(!1),l(),f(b),b.setProps({triggerTarget:o})},c=f(b),b},n.default=ne,n.delegate=function(e,n){"production"!==t.env.NODE_ENV&&D(!(n&&n.target),["You must specity a `target` prop indicating a CSS selector string matching","the target elements that should receive a tippy."].join(" "));var i=[],r=[],s=!1,o=n.target,a=p(n,["target"]),u=Object.assign({},a,{trigger:"manual",touch:!1}),l=Object.assign({},a,{showOnCreate:!0}),d=ne(e,u);function f(e){if(e.target&&!s){var t=e.target.closest(o);if(t){var i=t.getAttribute("data-tippy-trigger")||n.trigger||H.trigger;if(!t._tippy&&!("touchstart"===e.type&&"boolean"==typeof l.touch||"touchstart"!==e.type&&i.indexOf(re[e.type])<0)){var a=ne(t,l);a&&(r=r.concat(a))}}}}function m(e,t,n,r){void 0===r&&(r=!1),e.addEventListener(t,n,r),i.push({node:e,eventType:t,handler:n,options:r})}return h(d).forEach((function(e){var t=e.destroy,n=e.enable,o=e.disable;e.destroy=function(e){void 0===e&&(e=!0),e&&r.forEach((function(e){e.destroy()})),r=[],i.forEach((function(e){var t=e.node,n=e.eventType,i=e.handler,r=e.options;t.removeEventListener(n,i,r)})),i=[],t()},e.enable=function(){n(),r.forEach((function(e){return e.enable()})),s=!1},e.disable=function(){o(),r.forEach((function(e){return e.disable()})),s=!0},function(e){var t=e.reference;m(t,"touchstart",f,c),m(t,"mouseover",f),m(t,"focusin",f),m(t,"click",f)}(e)})),d},n.followCursor=ue,n.hideAll=function(e){var t=void 0===e?{}:e,n=t.exclude,i=t.duration;ee.forEach((function(e){var t=!1;if(n&&(t=w(n)?e.reference===n:e.popper===n.popper),!t){var r=e.props.duration;e.setProps({duration:i}),e.hide(),e.state.isDestroyed||e.setProps({duration:r})}}))},n.inlinePositioning=le,n.roundArrow='',n.sticky=de}).call(this)}).call(this,e("_process"))},{"@popperjs/core":1,_process:342}],485:[function(e,t,n){var i=e("buffer").Buffer;t.exports=function(e){if(e instanceof Uint8Array){if(0===e.byteOffset&&e.byteLength===e.buffer.byteLength)return e.buffer;if("function"==typeof e.buffer.slice)return e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength)}if(i.isBuffer(e)){for(var t=new Uint8Array(e.length),n=e.length,r=0;r-1}function d(e,t){return"function"==typeof e?e.apply(void 0,t):e}function f(e,t){return 0===t?e:function(n){clearTimeout(i),i=setTimeout((function(){e(n)}),t)};var i}function h(e,t){var i=Object.assign({},e);return t.forEach((function(e){delete i[e]})),i}function m(e){return[].concat(e)}function b(e,t){-1===e.indexOf(t)&&e.push(t)}function v(e){return e.split("-")[0]}function g(e){return[].slice.call(e)}function y(e){return Object.keys(e).reduce((function(t,i){return void 0!==e[i]&&(t[i]=e[i]),t}),{})}function _(){return document.createElement("div")}function x(e){return["Element","Fragment"].some((function(t){return p(e,t)}))}function w(e){return p(e,"MouseEvent")}function k(e){return!(!e||!e._tippy||e._tippy.reference!==e)}function E(e){return x(e)?[e]:function(e){return p(e,"NodeList")}(e)?g(e):Array.isArray(e)?e:g(document.querySelectorAll(e))}function S(e,t){e.forEach((function(e){e&&(e.style.transitionDuration=t+"ms")}))}function M(e,t){e.forEach((function(e){e&&e.setAttribute("data-state",t)}))}function A(e){var t,i=m(e)[0];return(null==i||null==(t=i.ownerDocument)?void 0:t.body)?i.ownerDocument:document}function j(e,t,i){var n=t+"EventListener";["transitionend","webkitTransitionEnd"].forEach((function(t){e[n](t,i)}))}function I(e,t){for(var i=t;i;){var n;if(e.contains(i))return!0;i=null==(n=null==i.getRootNode?void 0:i.getRootNode())?void 0:n.host}return!1}var T={isTouch:!1},C=0;function B(){T.isTouch||(T.isTouch=!0,window.performance&&document.addEventListener("mousemove",R))}function R(){var e=performance.now();e-C<20&&(T.isTouch=!1,document.removeEventListener("mousemove",R)),C=e}function L(){var e=document.activeElement;if(k(e)){var t=e._tippy;e.blur&&!t.state.isVisible&&e.blur()}}var O,P=!!("undefined"!=typeof window&&"undefined"!=typeof document)&&!!window.msCrypto;function U(e){return[e+"() was called on a"+("destroy"===e?"n already-":" ")+"destroyed instance. This is a no-op but","indicates a potential memory leak."].join(" ")}function q(e){return e.replace(/[ \t]{2,}/g," ").replace(/^[ \t]*/gm,"").trim()}function N(e){return q("\n %ctippy.js\n\n %c"+q(e)+"\n\n %c👷‍ This is a development-only message. It will be removed in production.\n ")}function D(e){return[N(e),"color: #00C584; font-size: 1.3em; font-weight: bold;","line-height: 1.5","color: #a6a095;"]}function z(e,t){var i;e&&!O.has(t)&&(O.add(t),(i=console).warn.apply(i,D(t)))}function H(e,t){var i;e&&!O.has(t)&&(O.add(t),(i=console).error.apply(i,D(t)))}"production"!==t.env.NODE_ENV&&(O=new Set);var F={animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},W=Object.assign({appendTo:l,aria:{content:"auto",expanded:"auto"},delay:0,duration:[300,250],getReferenceClientRect:null,hideOnClick:!0,ignoreAttributes:!1,interactive:!1,interactiveBorder:2,interactiveDebounce:0,moveTransition:"",offset:[0,10],onAfterUpdate:function(){},onBeforeUpdate:function(){},onCreate:function(){},onDestroy:function(){},onHidden:function(){},onHide:function(){},onMount:function(){},onShow:function(){},onShown:function(){},onTrigger:function(){},onUntrigger:function(){},onClickOutside:function(){},placement:"top",plugins:[],popperOptions:{},render:null,showOnCreate:!1,touch:!0,trigger:"mouseenter focus",triggerTarget:null},F,{},{allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999}),K=Object.keys(W);function V(e){var t=(e.plugins||[]).reduce((function(t,i){var n,r=i.name,s=i.defaultValue;r&&(t[r]=void 0!==e[r]?e[r]:null!=(n=W[r])?n:s);return t}),{});return Object.assign({},e,{},t)}function $(e,t){var i=Object.assign({},t,{content:d(t.content,[e])},t.ignoreAttributes?{}:function(e,t){return(t?Object.keys(V(Object.assign({},W,{plugins:t}))):K).reduce((function(t,i){var n=(e.getAttribute("data-tippy-"+i)||"").trim();if(!n)return t;if("content"===i)t[i]=n;else try{t[i]=JSON.parse(n)}catch(e){t[i]=n}return t}),{})}(e,t.plugins));return i.aria=Object.assign({},W.aria,{},i.aria),i.aria={expanded:"auto"===i.aria.expanded?t.interactive:i.aria.expanded,content:"auto"===i.aria.content?t.interactive?null:"describedby":i.aria.content},i}function G(e,t){void 0===e&&(e={}),void 0===t&&(t=[]),Object.keys(e).forEach((function(e){var i,n,r=h(W,Object.keys(F)),s=(i=r,n=e,!{}.hasOwnProperty.call(i,n));s&&(s=0===t.filter((function(t){return t.name===e})).length),z(s,["`"+e+"`","is not a valid prop. You may have spelled it incorrectly, or if it's","a plugin, forgot to pass it in an array as props.plugins.","\n\n","All props: https://atomiks.github.io/tippyjs/v6/all-props/\n","Plugins: https://atomiks.github.io/tippyjs/v6/plugins/"].join(" "))}))}function X(e,t){e.innerHTML=t}function Y(e){var t=_();return!0===e?t.className=a:(t.className=o,x(e)?t.appendChild(e):X(t,e)),t}function Z(e,t){x(t.content)?(X(e,""),e.appendChild(t.content)):"function"!=typeof t.content&&(t.allowHTML?X(e,t.content):e.textContent=t.content)}function J(e){var t=e.firstElementChild,i=g(t.children);return{box:t,content:i.find((function(e){return e.classList.contains(r)})),arrow:i.find((function(e){return e.classList.contains(a)||e.classList.contains(o)})),backdrop:i.find((function(e){return e.classList.contains(s)}))}}function Q(e){var t=_(),i=_();i.className="tippy-box",i.setAttribute("data-state","hidden"),i.setAttribute("tabindex","-1");var n=_();function s(i,n){var r=J(t),s=r.box,a=r.content,o=r.arrow;n.theme?s.setAttribute("data-theme",n.theme):s.removeAttribute("data-theme"),"string"==typeof n.animation?s.setAttribute("data-animation",n.animation):s.removeAttribute("data-animation"),n.inertia?s.setAttribute("data-inertia",""):s.removeAttribute("data-inertia"),s.style.maxWidth="number"==typeof n.maxWidth?n.maxWidth+"px":n.maxWidth,n.role?s.setAttribute("role",n.role):s.removeAttribute("role"),i.content===n.content&&i.allowHTML===n.allowHTML||Z(a,e.props),n.arrow?o?i.arrow!==n.arrow&&(s.removeChild(o),s.appendChild(Y(n.arrow))):s.appendChild(Y(n.arrow)):o&&s.removeChild(o)}return n.className=r,n.setAttribute("data-state","hidden"),Z(n,e.props),t.appendChild(i),i.appendChild(n),s(e.props,e.props),{popper:t,onUpdate:s}}Q.$$tippy=!0;var ee=1,te=[],ie=[];function ne(e,i){var r,s,a,o,p,h,x,k,E=$(e,Object.assign({},W,{},V(y(i)))),C=!1,B=!1,R=!1,L=!1,O=[],q=f(Ee,E.interactiveDebounce),N=ee++,D=(k=E.plugins).filter((function(e,t){return k.indexOf(e)===t})),F={id:N,reference:e,popper:_(),popperInstance:null,props:E,state:{isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},plugins:D,clearDelayTimeouts:function(){clearTimeout(r),clearTimeout(s),cancelAnimationFrame(a)},setProps:function(i){"production"!==t.env.NODE_ENV&&z(F.state.isDestroyed,U("setProps"));if(F.state.isDestroyed)return;ue("onBeforeUpdate",[F,i]),we();var n=F.props,r=$(e,Object.assign({},n,{},y(i),{ignoreAttributes:!0}));F.props=r,xe(),n.interactiveDebounce!==r.interactiveDebounce&&(fe(),q=f(Ee,r.interactiveDebounce));n.triggerTarget&&!r.triggerTarget?m(n.triggerTarget).forEach((function(e){e.removeAttribute("aria-expanded")})):r.triggerTarget&&e.removeAttribute("aria-expanded");de(),le(),X&&X(n,r);F.popperInstance&&(je(),Te().forEach((function(e){requestAnimationFrame(e._tippy.popperInstance.forceUpdate)})));ue("onAfterUpdate",[F,i])},setContent:function(e){F.setProps({content:e})},show:function(){"production"!==t.env.NODE_ENV&&z(F.state.isDestroyed,U("show"));var e=F.state.isVisible,i=F.state.isDestroyed,n=!F.state.isEnabled,r=T.isTouch&&!F.props.touch,s=u(F.props.duration,0,W.duration);if(e||i||n||r)return;if(se().hasAttribute("disabled"))return;if(ue("onShow",[F],!1),!1===F.props.onShow(F))return;F.state.isVisible=!0,re()&&(G.style.visibility="visible");le(),ve(),F.state.isMounted||(G.style.transition="none");if(re()){var a=oe(),o=a.box,c=a.content;S([o,c],0)}h=function(){var e;if(F.state.isVisible&&!L){if(L=!0,G.offsetHeight,G.style.transition=F.props.moveTransition,re()&&F.props.animation){var t=oe(),i=t.box,n=t.content;S([i,n],s),M([i,n],"visible")}pe(),de(),b(ie,F),null==(e=F.popperInstance)||e.forceUpdate(),F.state.isMounted=!0,ue("onMount",[F]),F.props.animation&&re()&&function(e,t){ye(e,t)}(s,(function(){F.state.isShown=!0,ue("onShown",[F])}))}},function(){var e,i=F.props.appendTo,n=se();e=F.props.interactive&&i===l||"parent"===i?n.parentNode:d(i,[n]);e.contains(G)||e.appendChild(G);je(),"production"!==t.env.NODE_ENV&&z(F.props.interactive&&i===W.appendTo&&n.nextElementSibling!==G,["Interactive tippy element may not be accessible via keyboard","navigation because it is not directly after the reference element","in the DOM source order.","\n\n","Using a wrapper
or tag around the reference element","solves this by creating a new parentNode context.","\n\n","Specifying `appendTo: document.body` silences this warning, but it","assumes you are using a focus management solution to handle","keyboard navigation.","\n\n","See: https://atomiks.github.io/tippyjs/v6/accessibility/#interactivity"].join(" "))}()},hide:function(){"production"!==t.env.NODE_ENV&&z(F.state.isDestroyed,U("hide"));var e=!F.state.isVisible,i=F.state.isDestroyed,n=!F.state.isEnabled,r=u(F.props.duration,1,W.duration);if(e||i||n)return;if(ue("onHide",[F],!1),!1===F.props.onHide(F))return;F.state.isVisible=!1,F.state.isShown=!1,L=!1,C=!1,re()&&(G.style.visibility="hidden");if(fe(),ge(),le(),re()){var s=oe(),a=s.box,o=s.content;F.props.animation&&(S([a,o],r),M([a,o],"hidden"))}pe(),de(),F.props.animation?re()&&function(e,t){ye(e,(function(){!F.state.isVisible&&G.parentNode&&G.parentNode.contains(G)&&t()}))}(r,F.unmount):F.unmount()},hideWithInteractivity:function(e){"production"!==t.env.NODE_ENV&&z(F.state.isDestroyed,U("hideWithInteractivity"));ae().addEventListener("mousemove",q),b(te,q),q(e)},enable:function(){F.state.isEnabled=!0},disable:function(){F.hide(),F.state.isEnabled=!1},unmount:function(){"production"!==t.env.NODE_ENV&&z(F.state.isDestroyed,U("unmount"));F.state.isVisible&&F.hide();if(!F.state.isMounted)return;Ie(),Te().forEach((function(e){e._tippy.unmount()})),G.parentNode&&G.parentNode.removeChild(G);ie=ie.filter((function(e){return e!==F})),F.state.isMounted=!1,ue("onHidden",[F])},destroy:function(){"production"!==t.env.NODE_ENV&&z(F.state.isDestroyed,U("destroy"));if(F.state.isDestroyed)return;F.clearDelayTimeouts(),F.unmount(),we(),delete e._tippy,F.state.isDestroyed=!0,ue("onDestroy",[F])}};if(!E.render)return"production"!==t.env.NODE_ENV&&H(!0,"render() function has not been supplied."),F;var K=E.render(F),G=K.popper,X=K.onUpdate;G.setAttribute("data-tippy-root",""),G.id="tippy-"+F.id,F.popper=G,e._tippy=F,G._tippy=F;var Y=D.map((function(e){return e.fn(F)})),Z=e.hasAttribute("aria-expanded");return xe(),de(),le(),ue("onCreate",[F]),E.showOnCreate&&Ce(),G.addEventListener("mouseenter",(function(){F.props.interactive&&F.state.isVisible&&F.clearDelayTimeouts()})),G.addEventListener("mouseleave",(function(e){F.props.interactive&&F.props.trigger.indexOf("mouseenter")>=0&&(ae().addEventListener("mousemove",q),q(e))})),F;function Q(){var e=F.props.touch;return Array.isArray(e)?e:[e,0]}function ne(){return"hold"===Q()[0]}function re(){var e;return!!(null==(e=F.props.render)?void 0:e.$$tippy)}function se(){return x||e}function ae(){var e=se().parentNode;return e?A(e):document}function oe(){return J(G)}function ce(e){return F.state.isMounted&&!F.state.isVisible||T.isTouch||o&&"focus"===o.type?0:u(F.props.delay,e?0:1,W.delay)}function le(){G.style.pointerEvents=F.props.interactive&&F.state.isVisible?"":"none",G.style.zIndex=""+F.props.zIndex}function ue(e,t,i){var n;(void 0===i&&(i=!0),Y.forEach((function(i){i[e]&&i[e].apply(void 0,t)})),i)&&(n=F.props)[e].apply(n,t)}function pe(){var t=F.props.aria;if(t.content){var i="aria-"+t.content,n=G.id;m(F.props.triggerTarget||e).forEach((function(e){var t=e.getAttribute(i);if(F.state.isVisible)e.setAttribute(i,t?t+" "+n:n);else{var r=t&&t.replace(n,"").trim();r?e.setAttribute(i,r):e.removeAttribute(i)}}))}}function de(){!Z&&F.props.aria.expanded&&m(F.props.triggerTarget||e).forEach((function(e){F.props.interactive?e.setAttribute("aria-expanded",F.state.isVisible&&e===se()?"true":"false"):e.removeAttribute("aria-expanded")}))}function fe(){ae().removeEventListener("mousemove",q),te=te.filter((function(e){return e!==q}))}function he(e){if(!T.isTouch||!R&&"mousedown"!==e.type){var t=e.composedPath&&e.composedPath()[0]||e.target;if(!F.props.interactive||!I(G,t)){if(I(se(),t)){if(T.isTouch)return;if(F.state.isVisible&&F.props.trigger.indexOf("click")>=0)return}else ue("onClickOutside",[F,e]);!0===F.props.hideOnClick&&(F.clearDelayTimeouts(),F.hide(),B=!0,setTimeout((function(){B=!1})),F.state.isMounted||ge())}}}function me(){R=!0}function be(){R=!1}function ve(){var e=ae();e.addEventListener("mousedown",he,!0),e.addEventListener("touchend",he,c),e.addEventListener("touchstart",be,c),e.addEventListener("touchmove",me,c)}function ge(){var e=ae();e.removeEventListener("mousedown",he,!0),e.removeEventListener("touchend",he,c),e.removeEventListener("touchstart",be,c),e.removeEventListener("touchmove",me,c)}function ye(e,t){var i=oe().box;function n(e){e.target===i&&(j(i,"remove",n),t())}if(0===e)return t();j(i,"remove",p),j(i,"add",n),p=n}function _e(t,i,n){void 0===n&&(n=!1),m(F.props.triggerTarget||e).forEach((function(e){e.addEventListener(t,i,n),O.push({node:e,eventType:t,handler:i,options:n})}))}function xe(){var e;ne()&&(_e("touchstart",ke,{passive:!0}),_e("touchend",Se,{passive:!0})),(e=F.props.trigger,e.split(/\s+/).filter(Boolean)).forEach((function(e){if("manual"!==e)switch(_e(e,ke),e){case"mouseenter":_e("mouseleave",Se);break;case"focus":_e(P?"focusout":"blur",Me);break;case"focusin":_e("focusout",Me)}}))}function we(){O.forEach((function(e){var t=e.node,i=e.eventType,n=e.handler,r=e.options;t.removeEventListener(i,n,r)})),O=[]}function ke(e){var t,i=!1;if(F.state.isEnabled&&!Ae(e)&&!B){var n="focus"===(null==(t=o)?void 0:t.type);o=e,x=e.currentTarget,de(),!F.state.isVisible&&w(e)&&te.forEach((function(t){return t(e)})),"click"===e.type&&(F.props.trigger.indexOf("mouseenter")<0||C)&&!1!==F.props.hideOnClick&&F.state.isVisible?i=!0:Ce(e),"click"===e.type&&(C=!i),i&&!n&&Be(e)}}function Ee(e){var t=e.target,i=se().contains(t)||G.contains(t);if("mousemove"!==e.type||!i){var n=Te().concat(G).map((function(e){var t,i=null==(t=e._tippy.popperInstance)?void 0:t.state;return i?{popperRect:e.getBoundingClientRect(),popperState:i,props:E}:null})).filter(Boolean);(function(e,t){var i=t.clientX,n=t.clientY;return e.every((function(e){var t=e.popperRect,r=e.popperState,s=e.props.interactiveBorder,a=v(r.placement),o=r.modifiersData.offset;if(!o)return!0;var c="bottom"===a?o.top.y:0,l="top"===a?o.bottom.y:0,u="right"===a?o.left.x:0,p="left"===a?o.right.x:0,d=t.top-n+c>s,f=n-t.bottom-l>s,h=t.left-i+u>s,m=i-t.right-p>s;return d||f||h||m}))})(n,e)&&(fe(),Be(e))}}function Se(e){Ae(e)||F.props.trigger.indexOf("click")>=0&&C||(F.props.interactive?F.hideWithInteractivity(e):Be(e))}function Me(e){F.props.trigger.indexOf("focusin")<0&&e.target!==se()||F.props.interactive&&e.relatedTarget&&G.contains(e.relatedTarget)||Be(e)}function Ae(e){return!!T.isTouch&&ne()!==e.type.indexOf("touch")>=0}function je(){Ie();var t=F.props,i=t.popperOptions,r=t.placement,s=t.offset,a=t.getReferenceClientRect,o=t.moveTransition,c=re()?J(G).arrow:null,l=a?{getBoundingClientRect:a,contextElement:a.contextElement||se()}:e,u={name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(e){var t=e.state;if(re()){var i=oe().box;["placement","reference-hidden","escaped"].forEach((function(e){"placement"===e?i.setAttribute("data-placement",t.placement):t.attributes.popper["data-popper-"+e]?i.setAttribute("data-"+e,""):i.removeAttribute("data-"+e)})),t.attributes.popper={}}}},p=[{name:"offset",options:{offset:s}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!o}},u];re()&&c&&p.push({name:"arrow",options:{element:c,padding:3}}),p.push.apply(p,(null==i?void 0:i.modifiers)||[]),F.popperInstance=n.createPopper(l,G,Object.assign({},i,{placement:r,onFirstUpdate:h,modifiers:p}))}function Ie(){F.popperInstance&&(F.popperInstance.destroy(),F.popperInstance=null)}function Te(){return g(G.querySelectorAll("[data-tippy-root]"))}function Ce(e){F.clearDelayTimeouts(),e&&ue("onTrigger",[F,e]),ve();var t=ce(!0),i=Q(),n=i[0],s=i[1];T.isTouch&&"hold"===n&&s&&(t=s),t?r=setTimeout((function(){F.show()}),t):F.show()}function Be(e){if(F.clearDelayTimeouts(),ue("onUntrigger",[F,e]),F.state.isVisible){if(!(F.props.trigger.indexOf("mouseenter")>=0&&F.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(e.type)>=0&&C)){var t=ce(!1);t?s=setTimeout((function(){F.state.isVisible&&F.hide()}),t):a=requestAnimationFrame((function(){F.hide()}))}}else ge()}}function re(e,i){void 0===i&&(i={});var n=W.plugins.concat(i.plugins||[]);"production"!==t.env.NODE_ENV&&(!function(e){var t=!e,i="[object Object]"===Object.prototype.toString.call(e)&&!e.addEventListener;H(t,["tippy() was passed","`"+String(e)+"`","as its targets (first) argument. Valid types are: String, Element,","Element[], or NodeList."].join(" ")),H(i,["tippy() was passed a plain object which is not supported as an argument","for virtual positioning. Use props.getReferenceClientRect instead."].join(" "))}(e),G(i,n)),document.addEventListener("touchstart",B,c),window.addEventListener("blur",L);var r=Object.assign({},i,{plugins:n}),s=E(e);if("production"!==t.env.NODE_ENV){var a=x(r.content),o=s.length>1;z(a&&o,["tippy() was passed an Element as the `content` prop, but more than","one tippy instance was created by this invocation. This means the","content element will only be appended to the last tippy instance.","\n\n","Instead, pass the .innerHTML of the element, or use a function that","returns a cloned version of the element instead.","\n\n","1) content: element.innerHTML\n","2) content: () => element.cloneNode(true)"].join(" "))}var l=s.reduce((function(e,t){var i=t&&ne(t,r);return i&&e.push(i),e}),[]);return x(e)?l[0]:l}re.defaultProps=W,re.setDefaultProps=function(e){"production"!==t.env.NODE_ENV&&G(e,[]),Object.keys(e).forEach((function(t){W[t]=e[t]}))},re.currentInput=T;var se=Object.assign({},n.applyStyles,{effect:function(e){var t=e.state,i={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(t.elements.popper.style,i.popper),t.styles=i,t.elements.arrow&&Object.assign(t.elements.arrow.style,i.arrow)}}),ae={mouseover:"mouseenter",focusin:"focus",click:"click"};var oe={name:"animateFill",defaultValue:!1,fn:function(e){var i;if(!(null==(i=e.props.render)?void 0:i.$$tippy))return"production"!==t.env.NODE_ENV&&H(e.props.animateFill,"The `animateFill` plugin requires the default render function."),{};var n=J(e.popper),r=n.box,a=n.content,o=e.props.animateFill?function(){var e=_();return e.className=s,M([e],"hidden"),e}():null;return{onCreate:function(){o&&(r.insertBefore(o,r.firstElementChild),r.setAttribute("data-animatefill",""),r.style.overflow="hidden",e.setProps({arrow:!1,animation:"shift-away"}))},onMount:function(){if(o){var e=r.style.transitionDuration,t=Number(e.replace("ms",""));a.style.transitionDelay=Math.round(t/10)+"ms",o.style.transitionDuration=e,M([o],"visible")}},onShow:function(){o&&(o.style.transitionDuration="0ms")},onHide:function(){o&&M([o],"hidden")}}}};var ce={clientX:0,clientY:0},le=[];function ue(e){var t=e.clientX,i=e.clientY;ce={clientX:t,clientY:i}}var pe={name:"followCursor",defaultValue:!1,fn:function(e){var t=e.reference,i=A(e.props.triggerTarget||t),n=!1,r=!1,s=!0,a=e.props;function o(){return"initial"===e.props.followCursor&&e.state.isVisible}function c(){i.addEventListener("mousemove",p)}function l(){i.removeEventListener("mousemove",p)}function u(){n=!0,e.setProps({getReferenceClientRect:null}),n=!1}function p(i){var n=!i.target||t.contains(i.target),r=e.props.followCursor,s=i.clientX,a=i.clientY,o=t.getBoundingClientRect(),c=s-o.left,l=a-o.top;!n&&e.props.interactive||e.setProps({getReferenceClientRect:function(){var e=t.getBoundingClientRect(),i=s,n=a;"initial"===r&&(i=e.left+c,n=e.top+l);var o="horizontal"===r?e.top:n,u="vertical"===r?e.right:i,p="horizontal"===r?e.bottom:n,d="vertical"===r?e.left:i;return{width:u-d,height:p-o,top:o,right:u,bottom:p,left:d}}})}function d(){e.props.followCursor&&(le.push({instance:e,doc:i}),function(e){e.addEventListener("mousemove",ue)}(i))}function f(){0===(le=le.filter((function(t){return t.instance!==e}))).filter((function(e){return e.doc===i})).length&&function(e){e.removeEventListener("mousemove",ue)}(i)}return{onCreate:d,onDestroy:f,onBeforeUpdate:function(){a=e.props},onAfterUpdate:function(t,i){var s=i.followCursor;n||void 0!==s&&a.followCursor!==s&&(f(),s?(d(),!e.state.isMounted||r||o()||c()):(l(),u()))},onMount:function(){e.props.followCursor&&!r&&(s&&(p(ce),s=!1),o()||c())},onTrigger:function(e,t){w(t)&&(ce={clientX:t.clientX,clientY:t.clientY}),r="focus"===t.type},onHidden:function(){e.props.followCursor&&(u(),l(),s=!0)}}}};var de={name:"inlinePositioning",defaultValue:!1,fn:function(e){var t,i=e.reference;var n=-1,r=!1,s=[],a={name:"tippyInlinePositioning",enabled:!0,phase:"afterWrite",fn:function(r){var a=r.state;e.props.inlinePositioning&&(-1!==s.indexOf(a.placement)&&(s=[]),t!==a.placement&&-1===s.indexOf(a.placement)&&(s.push(a.placement),e.setProps({getReferenceClientRect:function(){return function(e){return function(e,t,i,n){if(i.length<2||null===e)return t;if(2===i.length&&n>=0&&i[0].left>i[1].right)return i[n]||t;switch(e){case"top":case"bottom":var r=i[0],s=i[i.length-1],a="top"===e,o=r.top,c=s.bottom,l=a?r.left:s.left,u=a?r.right:s.right;return{top:o,bottom:c,left:l,right:u,width:u-l,height:c-o};case"left":case"right":var p=Math.min.apply(Math,i.map((function(e){return e.left}))),d=Math.max.apply(Math,i.map((function(e){return e.right}))),f=i.filter((function(t){return"left"===e?t.left===p:t.right===d})),h=f[0].top,m=f[f.length-1].bottom;return{top:h,bottom:m,left:p,right:d,width:d-p,height:m-h};default:return t}}(v(e),i.getBoundingClientRect(),g(i.getClientRects()),n)}(a.placement)}})),t=a.placement)}};function o(){var t;r||(t=function(e,t){var i;return{popperOptions:Object.assign({},e.popperOptions,{modifiers:[].concat(((null==(i=e.popperOptions)?void 0:i.modifiers)||[]).filter((function(e){return e.name!==t.name})),[t])})}}(e.props,a),r=!0,e.setProps(t),r=!1)}return{onCreate:o,onAfterUpdate:o,onTrigger:function(t,i){if(w(i)){var r=g(e.reference.getClientRects()),s=r.find((function(e){return e.left-2<=i.clientX&&e.right+2>=i.clientX&&e.top-2<=i.clientY&&e.bottom+2>=i.clientY})),a=r.indexOf(s);n=a>-1?a:n}},onHidden:function(){n=-1}}}};var fe={name:"sticky",defaultValue:!1,fn:function(e){var t=e.reference,i=e.popper;function n(t){return!0===e.props.sticky||e.props.sticky===t}var r=null,s=null;function a(){var o=n("reference")?(e.popperInstance?e.popperInstance.state.elements.reference:t).getBoundingClientRect():null,c=n("popper")?i.getBoundingClientRect():null;(o&&he(r,o)||c&&he(s,c))&&e.popperInstance&&e.popperInstance.update(),r=o,s=c,e.state.isMounted&&requestAnimationFrame(a)}return{onMount:function(){e.props.sticky&&a()}}}};function he(e,t){return!e||!t||(e.top!==t.top||e.right!==t.right||e.bottom!==t.bottom||e.left!==t.left)}re.setDefaultProps({render:Q}),i.animateFill=oe,i.createSingleton=function(e,i){var n;void 0===i&&(i={}),"production"!==t.env.NODE_ENV&&H(!Array.isArray(e),["The first argument passed to createSingleton() must be an array of","tippy instances. The passed value was",String(e)].join(" "));var r,s=e,a=[],o=i.overrides,c=[],l=!1;function u(){a=s.map((function(e){return e.reference}))}function p(e){s.forEach((function(t){e?t.enable():t.disable()}))}function d(e){return s.map((function(t){var i=t.setProps;return t.setProps=function(n){i(n),t.reference===r&&e.setProps(n)},function(){t.setProps=i}}))}function f(e,t){var i=a.indexOf(t);if(t!==r){r=t;var n=(o||[]).concat("content").reduce((function(e,t){return e[t]=s[i].props[t],e}),{});e.setProps(Object.assign({},n,{getReferenceClientRect:"function"==typeof n.getReferenceClientRect?n.getReferenceClientRect:function(){return t.getBoundingClientRect()}}))}}p(!1),u();var m={fn:function(){return{onDestroy:function(){p(!0)},onHidden:function(){r=null},onClickOutside:function(e){e.props.showOnCreate&&!l&&(l=!0,r=null)},onShow:function(e){e.props.showOnCreate&&!l&&(l=!0,f(e,a[0]))},onTrigger:function(e,t){f(e,t.currentTarget)}}}},b=re(_(),Object.assign({},h(i,["overrides"]),{plugins:[m].concat(i.plugins||[]),triggerTarget:a,popperOptions:Object.assign({},i.popperOptions,{modifiers:[].concat((null==(n=i.popperOptions)?void 0:n.modifiers)||[],[se])})})),v=b.show;b.show=function(e){if(v(),!r&&null==e)return f(b,a[0]);if(!r||null!=e){if("number"==typeof e)return a[e]&&f(b,a[e]);if(s.indexOf(e)>=0){var t=e.reference;return f(b,t)}return a.indexOf(e)>=0?f(b,e):void 0}},b.showNext=function(){var e=a[0];if(!r)return b.show(0);var t=a.indexOf(r);b.show(a[t+1]||e)},b.showPrevious=function(){var e=a[a.length-1];if(!r)return b.show(e);var t=a.indexOf(r),i=a[t-1]||e;b.show(i)};var g=b.setProps;return b.setProps=function(e){o=e.overrides||o,g(e)},b.setInstances=function(e){p(!0),c.forEach((function(e){return e()})),s=e,p(!1),u(),c=d(b),b.setProps({triggerTarget:a})},c=d(b),b},i.default=re,i.delegate=function(e,i){"production"!==t.env.NODE_ENV&&H(!(i&&i.target),["You must specity a `target` prop indicating a CSS selector string matching","the target elements that should receive a tippy."].join(" "));var n=[],r=[],s=!1,a=i.target,o=h(i,["target"]),l=Object.assign({},o,{trigger:"manual",touch:!1}),u=Object.assign({},o,{showOnCreate:!0}),p=re(e,l);function d(e){if(e.target&&!s){var t=e.target.closest(a);if(t){var n=t.getAttribute("data-tippy-trigger")||i.trigger||W.trigger;if(!t._tippy&&!("touchstart"===e.type&&"boolean"==typeof u.touch||"touchstart"!==e.type&&n.indexOf(ae[e.type])<0)){var o=re(t,u);o&&(r=r.concat(o))}}}}function f(e,t,i,r){void 0===r&&(r=!1),e.addEventListener(t,i,r),n.push({node:e,eventType:t,handler:i,options:r})}return m(p).forEach((function(e){var t=e.destroy,i=e.enable,a=e.disable;e.destroy=function(e){void 0===e&&(e=!0),e&&r.forEach((function(e){e.destroy()})),r=[],n.forEach((function(e){var t=e.node,i=e.eventType,n=e.handler,r=e.options;t.removeEventListener(i,n,r)})),n=[],t()},e.enable=function(){i(),r.forEach((function(e){return e.enable()})),s=!1},e.disable=function(){a(),r.forEach((function(e){return e.disable()})),s=!0},function(e){var t=e.reference;f(t,"touchstart",d,c),f(t,"mouseover",d),f(t,"focusin",d),f(t,"click",d)}(e)})),p},i.followCursor=pe,i.hideAll=function(e){var t=void 0===e?{}:e,i=t.exclude,n=t.duration;ie.forEach((function(e){var t=!1;if(i&&(t=k(i)?e.reference===i:e.popper===i.popper),!t){var r=e.props.duration;e.setProps({duration:n}),e.hide(),e.state.isDestroyed||e.setProps({duration:r})}}))},i.inlinePositioning=de,i.roundArrow='',i.sticky=fe}).call(this)}).call(this,e("_process"))},{"@popperjs/core":1,_process:341}],476:[function(e,t,i){var n=e("buffer").Buffer;t.exports=function(e){if(e instanceof Uint8Array){if(0===e.byteOffset&&e.byteLength===e.buffer.byteLength)return e.buffer;if("function"==typeof e.buffer.slice)return e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength)}if(n.isBuffer(e)){for(var t=new Uint8Array(e.length),i=e.length,r=0;r */ -const i=e("debug")("torrent-discovery"),r=e("bittorrent-dht/client"),s=e("events").EventEmitter,o=e("run-parallel"),a=e("bittorrent-tracker/client"),c=e("bittorrent-lsd");t.exports=class extends s{constructor(e){if(super(),!e.peerId)throw new Error("Option `peerId` is required");if(!e.infoHash)throw new Error("Option `infoHash` is required");if(!n.browser&&!e.port)throw new Error("Option `port` is required");this.peerId="string"==typeof e.peerId?e.peerId:e.peerId.toString("hex"),this.infoHash="string"==typeof e.infoHash?e.infoHash.toLowerCase():e.infoHash.toString("hex"),this._port=e.port,this._userAgent=e.userAgent,this.destroyed=!1,this._announce=e.announce||[],this._intervalMs=e.intervalMs||9e5,this._trackerOpts=null,this._dhtAnnouncing=!1,this._dhtTimeout=!1,this._internalDHT=!1,this._onWarning=e=>{this.emit("warning",e)},this._onError=e=>{this.emit("error",e)},this._onDHTPeer=(e,t)=>{t.toString("hex")===this.infoHash&&this.emit("peer",`${e.host}:${e.port}`,"dht")},this._onTrackerPeer=e=>{this.emit("peer",e,"tracker")},this._onTrackerAnnounce=()=>{this.emit("trackerAnnounce")},this._onLSDPeer=(e,t)=>{this.emit("peer",e,"lsd")};const t=(e,t)=>{const n=new r(t);return n.on("warning",this._onWarning),n.on("error",this._onError),n.listen(e),this._internalDHT=!0,n};!1===e.tracker?this.tracker=null:e.tracker&&"object"==typeof e.tracker?(this._trackerOpts=Object.assign({},e.tracker),this.tracker=this._createTracker()):this.tracker=this._createTracker(),!1===e.dht||"function"!=typeof r?this.dht=null:e.dht&&"function"==typeof e.dht.addNode?this.dht=e.dht:e.dht&&"object"==typeof e.dht?this.dht=t(e.dhtPort,e.dht):this.dht=t(e.dhtPort),this.dht&&(this.dht.on("peer",this._onDHTPeer),this._dhtAnnounce()),!1===e.lsd||"function"!=typeof c?this.lsd=null:this.lsd=this._createLSD()}updatePort(e){e!==this._port&&(this._port=e,this.dht&&this._dhtAnnounce(),this.tracker&&(this.tracker.stop(),this.tracker.destroy((()=>{this.tracker=this._createTracker()}))))}complete(e){this.tracker&&this.tracker.complete(e)}destroy(e){if(this.destroyed)return;this.destroyed=!0,clearTimeout(this._dhtTimeout);const t=[];this.tracker&&(this.tracker.stop(),this.tracker.removeListener("warning",this._onWarning),this.tracker.removeListener("error",this._onError),this.tracker.removeListener("peer",this._onTrackerPeer),this.tracker.removeListener("update",this._onTrackerAnnounce),t.push((e=>{this.tracker.destroy(e)}))),this.dht&&this.dht.removeListener("peer",this._onDHTPeer),this._internalDHT&&(this.dht.removeListener("warning",this._onWarning),this.dht.removeListener("error",this._onError),t.push((e=>{this.dht.destroy(e)}))),this.lsd&&(this.lsd.removeListener("warning",this._onWarning),this.lsd.removeListener("error",this._onError),this.lsd.removeListener("peer",this._onLSDPeer),t.push((e=>{this.lsd.destroy(e)}))),o(t,e),this.dht=null,this.tracker=null,this.lsd=null,this._announce=null}_createTracker(){const e=Object.assign({},this._trackerOpts,{infoHash:this.infoHash,announce:this._announce,peerId:this.peerId,port:this._port,userAgent:this._userAgent}),t=new a(e);return t.on("warning",this._onWarning),t.on("error",this._onError),t.on("peer",this._onTrackerPeer),t.on("update",this._onTrackerAnnounce),t.setInterval(this._intervalMs),t.start(),t}_dhtAnnounce(){this._dhtAnnouncing||(i("dht announce"),this._dhtAnnouncing=!0,clearTimeout(this._dhtTimeout),this.dht.announce(this.infoHash,this._port,(e=>{this._dhtAnnouncing=!1,i("dht announce complete"),e&&this.emit("warning",e),this.emit("dhtAnnounce"),this.destroyed||(this._dhtTimeout=setTimeout((()=>{this._dhtAnnounce()}),this._intervalMs+Math.floor(Math.random()*this._intervalMs/5)),this._dhtTimeout.unref&&this._dhtTimeout.unref())})))}_createLSD(){const e=Object.assign({},{infoHash:this.infoHash,peerId:this.peerId,port:this._port}),t=new c(e);return t.on("warning",this._onWarning),t.on("error",this._onError),t.on("peer",this._onLSDPeer),t.start(),t}}}).call(this)}).call(this,e("_process"))},{_process:342,"bittorrent-dht/client":73,"bittorrent-lsd":73,"bittorrent-tracker/client":47,debug:487,events:196,"run-parallel":384}],487:[function(e,t,n){arguments[4][29][0].apply(n,arguments)},{"./common":488,_process:342,dup:29}],488:[function(e,t,n){arguments[4][30][0].apply(n,arguments)},{dup:30,ms:489}],489:[function(e,t,n){arguments[4][31][0].apply(n,arguments)},{dup:31}],490:[function(e,t,n){(function(e){(function(){ +const n=e("debug")("torrent-discovery"),r=e("bittorrent-dht/client"),s=e("events").EventEmitter,a=e("run-parallel"),o=e("bittorrent-tracker/client"),c=e("bittorrent-lsd");t.exports=class extends s{constructor(e){if(super(),!e.peerId)throw new Error("Option `peerId` is required");if(!e.infoHash)throw new Error("Option `infoHash` is required");if(!i.browser&&!e.port)throw new Error("Option `port` is required");this.peerId="string"==typeof e.peerId?e.peerId:e.peerId.toString("hex"),this.infoHash="string"==typeof e.infoHash?e.infoHash.toLowerCase():e.infoHash.toString("hex"),this._port=e.port,this._userAgent=e.userAgent,this.destroyed=!1,this._announce=e.announce||[],this._intervalMs=e.intervalMs||9e5,this._trackerOpts=null,this._dhtAnnouncing=!1,this._dhtTimeout=!1,this._internalDHT=!1,this._onWarning=e=>{this.emit("warning",e)},this._onError=e=>{this.emit("error",e)},this._onDHTPeer=(e,t)=>{t.toString("hex")===this.infoHash&&this.emit("peer",`${e.host}:${e.port}`,"dht")},this._onTrackerPeer=e=>{this.emit("peer",e,"tracker")},this._onTrackerAnnounce=()=>{this.emit("trackerAnnounce")},this._onLSDPeer=(e,t)=>{this.emit("peer",e,"lsd")};const t=(e,t)=>{const i=new r(t);return i.on("warning",this._onWarning),i.on("error",this._onError),i.listen(e),this._internalDHT=!0,i};!1===e.tracker?this.tracker=null:e.tracker&&"object"==typeof e.tracker?(this._trackerOpts=Object.assign({},e.tracker),this.tracker=this._createTracker()):this.tracker=this._createTracker(),!1===e.dht||"function"!=typeof r?this.dht=null:e.dht&&"function"==typeof e.dht.addNode?this.dht=e.dht:e.dht&&"object"==typeof e.dht?this.dht=t(e.dhtPort,e.dht):this.dht=t(e.dhtPort),this.dht&&(this.dht.on("peer",this._onDHTPeer),this._dhtAnnounce()),!1===e.lsd||"function"!=typeof c?this.lsd=null:this.lsd=this._createLSD()}updatePort(e){e!==this._port&&(this._port=e,this.dht&&this._dhtAnnounce(),this.tracker&&(this.tracker.stop(),this.tracker.destroy((()=>{this.tracker=this._createTracker()}))))}complete(e){this.tracker&&this.tracker.complete(e)}destroy(e){if(this.destroyed)return;this.destroyed=!0,clearTimeout(this._dhtTimeout);const t=[];this.tracker&&(this.tracker.stop(),this.tracker.removeListener("warning",this._onWarning),this.tracker.removeListener("error",this._onError),this.tracker.removeListener("peer",this._onTrackerPeer),this.tracker.removeListener("update",this._onTrackerAnnounce),t.push((e=>{this.tracker.destroy(e)}))),this.dht&&this.dht.removeListener("peer",this._onDHTPeer),this._internalDHT&&(this.dht.removeListener("warning",this._onWarning),this.dht.removeListener("error",this._onError),t.push((e=>{this.dht.destroy(e)}))),this.lsd&&(this.lsd.removeListener("warning",this._onWarning),this.lsd.removeListener("error",this._onError),this.lsd.removeListener("peer",this._onLSDPeer),t.push((e=>{this.lsd.destroy(e)}))),a(t,e),this.dht=null,this.tracker=null,this.lsd=null,this._announce=null}_createTracker(){const e=Object.assign({},this._trackerOpts,{infoHash:this.infoHash,announce:this._announce,peerId:this.peerId,port:this._port,userAgent:this._userAgent}),t=new o(e);return t.on("warning",this._onWarning),t.on("error",this._onError),t.on("peer",this._onTrackerPeer),t.on("update",this._onTrackerAnnounce),t.setInterval(this._intervalMs),t.start(),t}_dhtAnnounce(){this._dhtAnnouncing||(n("dht announce"),this._dhtAnnouncing=!0,clearTimeout(this._dhtTimeout),this.dht.announce(this.infoHash,this._port,(e=>{this._dhtAnnouncing=!1,n("dht announce complete"),e&&this.emit("warning",e),this.emit("dhtAnnounce"),this.destroyed||(this._dhtTimeout=setTimeout((()=>{this._dhtAnnounce()}),this._intervalMs+Math.floor(Math.random()*this._intervalMs/5)),this._dhtTimeout.unref&&this._dhtTimeout.unref())})))}_createLSD(){const e=Object.assign({},{infoHash:this.infoHash,peerId:this.peerId,port:this._port}),t=new c(e);return t.on("warning",this._onWarning),t.on("error",this._onError),t.on("peer",this._onLSDPeer),t.start(),t}}}).call(this)}).call(this,e("_process"))},{_process:341,"bittorrent-dht/client":67,"bittorrent-lsd":67,"bittorrent-tracker/client":44,debug:161,events:193,"run-parallel":381}],478:[function(e,t,i){(function(e){(function(){ /*! torrent-piece. MIT License. WebTorrent LLC */ -const n=16384;class i{constructor(e){this.length=e,this.missing=e,this.sources=null,this._chunks=Math.ceil(e/n),this._remainder=e%n||n,this._buffered=0,this._buffer=null,this._cancellations=null,this._reservations=0,this._flushed=!1}chunkLength(e){return e===this._chunks-1?this._remainder:n}chunkLengthRemaining(e){return this.length-e*n}chunkOffset(e){return e*n}reserve(){return this.init()?this._cancellations.length?this._cancellations.pop():this._reservations=e.length||t<0)return;var n=e.pop();if(t",'"',"`"," ","\r","\n","\t"]),l=["'"].concat(u),d=["%","/","?",";","#"].concat(l),f=["/","?","#"],p=/^[+a-z0-9A-Z_-]{0,63}$/,h=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,m={javascript:!0,"javascript:":!0},b={javascript:!0,"javascript:":!0},g={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},v=e("querystring");function y(e,t,n){if(e&&r.isObject(e)&&e instanceof s)return e;var i=new s;return i.parse(e,t,n),i}s.prototype.parse=function(e,t,n){if(!r.isString(e))throw new TypeError("Parameter 'url' must be a string, not "+typeof e);var s=e.indexOf("?"),a=-1!==s&&s127?R+="x":R+=B[L];if(!R.match(p)){var P=j.slice(0,A),U=j.slice(A+1),q=B.match(h);q&&(P.push(q[1]),U.unshift(q[2])),U.length&&(y="/"+U.join(".")+y),this.hostname=P.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),T||(this.hostname=i.toASCII(this.hostname));var N=this.port?":"+this.port:"",D=this.hostname||"";this.host=D+N,this.href+=this.host,T&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==y[0]&&(y="/"+y))}if(!m[x])for(A=0,C=l.length;A0)&&n.host.split("@"))&&(n.auth=T.shift(),n.host=n.hostname=T.shift());return n.search=e.search,n.query=e.query,r.isNull(n.pathname)&&r.isNull(n.search)||(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.href=n.format(),n}if(!k.length)return n.pathname=null,n.search?n.path="/"+n.search:n.path=null,n.href=n.format(),n;for(var S=k.slice(-1)[0],M=(n.host||e.host||k.length>1)&&("."===S||".."===S)||""===S,A=0,I=k.length;I>=0;I--)"."===(S=k[I])?k.splice(I,1):".."===S?(k.splice(I,1),A++):A&&(k.splice(I,1),A--);if(!w&&!x)for(;A--;A)k.unshift("..");!w||""===k[0]||k[0]&&"/"===k[0].charAt(0)||k.unshift(""),M&&"/"!==k.join("/").substr(-1)&&k.push("");var T,j=""===k[0]||k[0]&&"/"===k[0].charAt(0);E&&(n.hostname=n.host=j?"":k.length?k.shift():"",(T=!!(n.host&&n.host.indexOf("@")>0)&&n.host.split("@"))&&(n.auth=T.shift(),n.host=n.hostname=T.shift()));return(w=w||n.host&&k.length)&&!j&&k.unshift(""),k.length?n.pathname=k.join("/"):(n.pathname=null,n.path=null),r.isNull(n.pathname)&&r.isNull(n.search)||(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.auth=e.auth||n.auth,n.slashes=n.slashes||e.slashes,n.href=n.format(),n},s.prototype.parseHost=function(){var e=this.host,t=a.exec(e);t&&(":"!==(t=t[0])&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)}},{"./util":495,punycode:351,querystring:354}],495:[function(e,t,n){"use strict";t.exports={isString:function(e){return"string"==typeof e},isObject:function(e){return"object"==typeof e&&null!==e},isNull:function(e){return null===e},isNullOrUndefined:function(e){return null==e}}},{}],496:[function(e,t,n){(function(n){(function(){ +const i=16384;class n{constructor(e){this.length=e,this.missing=e,this.sources=null,this._chunks=Math.ceil(e/i),this._remainder=e%i||i,this._buffered=0,this._buffer=null,this._cancellations=null,this._reservations=0,this._flushed=!1}chunkLength(e){return e===this._chunks-1?this._remainder:i}chunkLengthRemaining(e){return this.length-e*i}chunkOffset(e){return e*i}reserve(){return this.init()?this._cancellations.length?this._cancellations.pop():this._reservations=e.length||t<0)return;var i=e.pop();if(t",'"',"`"," ","\r","\n","\t"]),u=["'"].concat(l),p=["%","/","?",";","#"].concat(u),d=["/","?","#"],f=/^[+a-z0-9A-Z_-]{0,63}$/,h=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,m={javascript:!0,"javascript:":!0},b={javascript:!0,"javascript:":!0},v={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},g=e("querystring");function y(e,t,i){if(e&&r.isObject(e)&&e instanceof s)return e;var n=new s;return n.parse(e,t,i),n}s.prototype.parse=function(e,t,i){if(!r.isString(e))throw new TypeError("Parameter 'url' must be a string, not "+typeof e);var s=e.indexOf("?"),o=-1!==s&&s127?R+="x":R+=B[L];if(!R.match(f)){var P=T.slice(0,A),U=T.slice(A+1),q=B.match(h);q&&(P.push(q[1]),U.unshift(q[2])),U.length&&(y="/"+U.join(".")+y),this.hostname=P.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),I||(this.hostname=n.toASCII(this.hostname));var N=this.port?":"+this.port:"",D=this.hostname||"";this.host=D+N,this.href+=this.host,I&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==y[0]&&(y="/"+y))}if(!m[w])for(A=0,C=u.length;A0)&&i.host.split("@"))&&(i.auth=I.shift(),i.host=i.hostname=I.shift());return i.search=e.search,i.query=e.query,r.isNull(i.pathname)&&r.isNull(i.search)||(i.path=(i.pathname?i.pathname:"")+(i.search?i.search:"")),i.href=i.format(),i}if(!k.length)return i.pathname=null,i.search?i.path="/"+i.search:i.path=null,i.href=i.format(),i;for(var S=k.slice(-1)[0],M=(i.host||e.host||k.length>1)&&("."===S||".."===S)||""===S,A=0,j=k.length;j>=0;j--)"."===(S=k[j])?k.splice(j,1):".."===S?(k.splice(j,1),A++):A&&(k.splice(j,1),A--);if(!x&&!w)for(;A--;A)k.unshift("..");!x||""===k[0]||k[0]&&"/"===k[0].charAt(0)||k.unshift(""),M&&"/"!==k.join("/").substr(-1)&&k.push("");var I,T=""===k[0]||k[0]&&"/"===k[0].charAt(0);E&&(i.hostname=i.host=T?"":k.length?k.shift():"",(I=!!(i.host&&i.host.indexOf("@")>0)&&i.host.split("@"))&&(i.auth=I.shift(),i.host=i.hostname=I.shift()));return(x=x||i.host&&k.length)&&!T&&k.unshift(""),k.length?i.pathname=k.join("/"):(i.pathname=null,i.path=null),r.isNull(i.pathname)&&r.isNull(i.search)||(i.path=(i.pathname?i.pathname:"")+(i.search?i.search:"")),i.auth=e.auth||i.auth,i.slashes=i.slashes||e.slashes,i.href=i.format(),i},s.prototype.parseHost=function(){var e=this.host,t=o.exec(e);t&&(":"!==(t=t[0])&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)}},{"./util":483,punycode:350,querystring:353}],483:[function(e,t,i){"use strict";t.exports={isString:function(e){return"string"==typeof e},isObject:function(e){return"object"==typeof e&&null!==e},isNull:function(e){return null===e},isNullOrUndefined:function(e){return null==e}}},{}],484:[function(e,t,i){(function(i){(function(){ /*! ut_metadata. MIT License. WebTorrent LLC */ -const{EventEmitter:i}=e("events"),r=e("bencode"),s=e("bitfield").default,o=e("debug")("ut_metadata"),a=e("simple-sha1"),c=16384;t.exports=e=>{class t extends i{constructor(t){super(),this._wire=t,this._fetching=!1,this._metadataComplete=!1,this._metadataSize=null,this._remainingRejects=null,this._bitfield=new s(0,{grow:1e3}),n.isBuffer(e)&&this.setMetadata(e)}onHandshake(e,t,n){this._infoHash=e}onExtendedHandshake(e){return e.m&&e.m.ut_metadata?e.metadata_size?"number"!=typeof e.metadata_size||1e7this._metadataSize&&(n=this._metadataSize);const i=this.metadata.slice(t,n);this._data(e,i,this._metadataSize)}_onData(e,t,n){t.length>c||!this._fetching||(t.copy(this.metadata,e*c),this._bitfield.set(e),this._checkDone())}_onReject(e){this._remainingRejects>0&&this._fetching?(this._request(e),this._remainingRejects-=1):this.emit("warning",new Error('Peer sent "reject" too much'))}_requestPieces(){if(this._fetching){this.metadata=n.alloc(this._metadataSize);for(let e=0;e0?this._requestPieces():this.emit("warning",new Error("Peer sent invalid metadata"))}}return t.prototype.name="ut_metadata",t}}).call(this)}).call(this,e("buffer").Buffer)},{bencode:23,bitfield:27,buffer:116,debug:497,events:196,"simple-sha1":417}],497:[function(e,t,n){arguments[4][29][0].apply(n,arguments)},{"./common":498,_process:342,dup:29}],498:[function(e,t,n){arguments[4][30][0].apply(n,arguments)},{dup:30,ms:499}],499:[function(e,t,n){arguments[4][31][0].apply(n,arguments)},{dup:31}],500:[function(e,t,n){(function(e){(function(){function n(t){try{if(!e.localStorage)return!1}catch(e){return!1}var n=e.localStorage[t];return null!=n&&"true"===String(n).toLowerCase()}t.exports=function(e,t){if(n("noDeprecation"))return e;var i=!1;return function(){if(!i){if(n("throwDeprecation"))throw new Error(t);n("traceDeprecation")?console.trace(t):console.warn(t),i=!0}return e.apply(this,arguments)}}}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],501:[function(e,t,n){(function(n){(function(){const i=e("binary-search"),r=e("events"),s=e("mp4-stream"),o=e("mp4-box-encoding"),a=e("range-slice-stream");class c{constructor(e,t){this._entries=e,this._countName=t||"count",this._index=0,this._offset=0,this.value=this._entries[0]}inc(){this._offset++,this._offset>=this._entries[this._index][this._countName]&&(this._index++,this._offset=0),this.value=this._entries[this._index]}}const u=1;t.exports=class extends r{constructor(e){super(),this._tracks=[],this._file=e,this._decoder=null,this._findMoov(0)}_findMoov(e){this._decoder&&this._decoder.destroy();let t=0;this._decoder=s.decode();const n=this._file.createReadStream({start:e});n.pipe(this._decoder);const i=r=>{"moov"===r.type?(this._decoder.removeListener("box",i),this._decoder.decode((e=>{n.destroy();try{this._processMoov(e)}catch(e){e.message=`Cannot parse mp4 file: ${e.message}`,this.emit("error",e)}}))):r.length<4096?(t+=r.length,this._decoder.ignore()):(this._decoder.removeListener("box",i),t+=r.length,n.destroy(),this._decoder.destroy(),this._findMoov(e+t))};this._decoder.on("box",i)}_processMoov(e){const t=e.traks;this._tracks=[],this._hasVideo=!1,this._hasAudio=!1;for(let n=0;n=s.stsz.entries.length)break;if(p++,m+=e,p>=i.samplesPerChunk){p=0,m=0,h++;const e=s.stsc.entries[b+1];e&&h+1>=e.firstChunk&&b++}g+=t,v.inc(),y&&y.inc(),r&&_++}r.mdia.mdhd.duration=0,r.tkhd.duration=0;const w=i.sampleDescriptionId,x={type:"moov",mvhd:e.mvhd,traks:[{tkhd:r.tkhd,mdia:{mdhd:r.mdia.mdhd,hdlr:r.mdia.hdlr,elng:r.mdia.elng,minf:{vmhd:r.mdia.minf.vmhd,smhd:r.mdia.minf.smhd,dinf:r.mdia.minf.dinf,stbl:{stsd:s.stsd,stts:{version:0,flags:0,entries:[]},ctts:{version:0,flags:0,entries:[]},stsc:{version:0,flags:0,entries:[]},stsz:{version:0,flags:0,entries:[]},stco:{version:0,flags:0,entries:[]},stss:{version:0,flags:0,entries:[]}}}}}],mvex:{mehd:{fragmentDuration:e.mvhd.duration},trexs:[{trackId:r.tkhd.trackId,defaultSampleDescriptionIndex:w,defaultSampleDuration:0,defaultSampleSize:0,defaultSampleFlags:0}]}};this._tracks.push({fragmentSequence:1,trackId:r.tkhd.trackId,timeScale:r.mdia.mdhd.timeScale,samples:d,currSample:null,currTime:null,moov:x,mime:l})}if(0===this._tracks.length)return void this.emit("error",new Error("no playable tracks"));e.mvhd.duration=0,this._ftyp={type:"ftyp",brand:"iso5",brandVersion:0,compatibleBrands:["iso5"]};const r=o.encode(this._ftyp),s=this._tracks.map((e=>{const t=o.encode(e.moov);return{mime:e.mime,init:n.concat([r,t])}}));this.emit("ready",s)}seek(e){if(!this._tracks)throw new Error("Not ready yet; wait for 'ready' event");this._fileStream&&(this._fileStream.destroy(),this._fileStream=null);let t=-1;if(this._tracks.map(((n,i)=>{n.outStream&&n.outStream.destroy(),n.inStream&&(n.inStream.destroy(),n.inStream=null);const r=n.outStream=s.encode(),o=this._generateFragment(i,e);if(!o)return r.finalize();(-1===t||o.ranges[0].start{r.destroyed||r.box(e.moof,(t=>{if(t)return this.emit("error",t);if(r.destroyed)return;n.inStream.slice(e.ranges).pipe(r.mediaData(e.length,(e=>{if(e)return this.emit("error",e);if(r.destroyed)return;const t=this._generateFragment(i);if(!t)return r.finalize();a(t)})))}))};a(o)})),t>=0){const e=this._fileStream=this._file.createReadStream({start:t});this._tracks.forEach((n=>{n.inStream=new a(t,{highWaterMark:1e7}),e.pipe(n.inStream)}))}return this._tracks.map((e=>e.outStream))}_findSampleBefore(e,t){const n=this._tracks[e],r=Math.floor(n.timeScale*t);let s=i(n.samples,r,((e,t)=>e.dts+e.presentationOffset-t));for(-1===s?s=0:s<0&&(s=-s-2);!n.samples[s].sync;)s--;return s}_generateFragment(e,t){const n=this._tracks[e];let i;if(i=void 0!==t?this._findSampleBefore(e,t):n.currSample,i>=n.samples.length)return null;const r=n.samples[i].dts;let s=0;const o=[];for(var a=i;a=n.timeScale*u)break;s+=e.size;const t=o.length-1;t<0||o[t].end!==e.offset?o.push({start:e.offset,end:e.offset+e.size}):o[t].end+=e.size}return n.currSample=a,{moof:this._generateMoof(e,i,a),ranges:o,length:s}}_generateMoof(e,t,n){const i=this._tracks[e],r=[];let s=0;for(let e=t;e{this.detailedError=this._elemWrapper.detailedError,this.destroy()},this._onWaiting=()=>{this._waitingFired=!0,this._muxer?this._tracks&&this._pump():this._createMuxer()},t.autoplay&&(t.preload="auto"),t.addEventListener("waiting",this._onWaiting),t.addEventListener("error",this._onError)}o.prototype={_createMuxer(){this._muxer=new s(this._file),this._muxer.on("ready",(e=>{this._tracks=e.map((e=>{const t=this._elemWrapper.createWriteStream(e.mime);t.on("error",(e=>{this._elemWrapper.error(e)}));const n={muxed:null,mediaSource:t,initFlushed:!1,onInitFlushed:null};return t.write(e.init,(e=>{n.initFlushed=!0,n.onInitFlushed&&n.onInitFlushed(e)})),n})),(this._waitingFired||"auto"===this._elem.preload)&&this._pump()})),this._muxer.on("error",(e=>{this._elemWrapper.error(e)}))},_pump(){const e=this._muxer.seek(this._elem.currentTime,!this._tracks);this._tracks.forEach(((t,n)=>{const i=()=>{t.muxed&&(t.muxed.destroy(),t.mediaSource=this._elemWrapper.createWriteStream(t.mediaSource),t.mediaSource.on("error",(e=>{this._elemWrapper.error(e)}))),t.muxed=e[n],r(t.muxed,t.mediaSource)};t.initFlushed?i():t.onInitFlushed=e=>{e?this._elemWrapper.error(e):i()}}))},destroy(){this.destroyed||(this.destroyed=!0,this._elem.removeEventListener("waiting",this._onWaiting),this._elem.removeEventListener("error",this._onError),this._tracks&&this._tracks.forEach((e=>{e.muxed&&e.muxed.destroy()})),this._elem.src="")}},t.exports=o},{"./mp4-remuxer":501,mediasource:265,pump:350}],503:[function(e,t,n){(function(n){(function(){ +const{EventEmitter:n}=e("events"),r=e("bencode"),s=e("bitfield").default,a=e("debug")("ut_metadata"),o=e("simple-sha1"),c=16384;t.exports=e=>{class t extends n{constructor(t){super(),this._wire=t,this._fetching=!1,this._metadataComplete=!1,this._metadataSize=null,this._remainingRejects=null,this._bitfield=new s(0,{grow:1e3}),i.isBuffer(e)&&this.setMetadata(e)}onHandshake(e,t,i){this._infoHash=e}onExtendedHandshake(e){return e.m&&e.m.ut_metadata?e.metadata_size?"number"!=typeof e.metadata_size||1e7this._metadataSize&&(i=this._metadataSize);const n=this.metadata.slice(t,i);this._data(e,n,this._metadataSize)}_onData(e,t,i){t.length>c||!this._fetching||(t.copy(this.metadata,e*c),this._bitfield.set(e),this._checkDone())}_onReject(e){this._remainingRejects>0&&this._fetching?(this._request(e),this._remainingRejects-=1):this.emit("warning",new Error('Peer sent "reject" too much'))}_requestPieces(){if(this._fetching){this.metadata=i.alloc(this._metadataSize);for(let e=0;e0?this._requestPieces():this.emit("warning",new Error("Peer sent invalid metadata"))}}return t.prototype.name="ut_metadata",t}}).call(this)}).call(this,e("buffer").Buffer)},{bencode:23,bitfield:27,buffer:110,debug:161,events:193,"simple-sha1":411}],485:[function(e,t,i){(function(e){(function(){function i(t){try{if(!e.localStorage)return!1}catch(e){return!1}var i=e.localStorage[t];return null!=i&&"true"===String(i).toLowerCase()}t.exports=function(e,t){if(i("noDeprecation"))return e;var n=!1;return function(){if(!n){if(i("throwDeprecation"))throw new Error(t);i("traceDeprecation")?console.trace(t):console.warn(t),n=!0}return e.apply(this,arguments)}}}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],486:[function(e,t,i){(function(i){(function(){const n=e("binary-search"),r=e("events"),s=e("mp4-stream"),a=e("mp4-box-encoding"),o=e("range-slice-stream");class c{constructor(e,t){this._entries=e,this._countName=t||"count",this._index=0,this._offset=0,this.value=this._entries[0]}inc(){this._offset++,this._offset>=this._entries[this._index][this._countName]&&(this._index++,this._offset=0),this.value=this._entries[this._index]}}const l=1;t.exports=class extends r{constructor(e){super(),this._tracks=[],this._file=e,this._decoder=null,this._findMoov(0)}_findMoov(e){this._decoder&&this._decoder.destroy();let t=0;this._decoder=s.decode();const i=this._file.createReadStream({start:e});i.pipe(this._decoder);const n=r=>{"moov"===r.type?(this._decoder.removeListener("box",n),this._decoder.decode((e=>{i.destroy();try{this._processMoov(e)}catch(e){e.message=`Cannot parse mp4 file: ${e.message}`,this.emit("error",e)}}))):r.length<4096?(t+=r.length,this._decoder.ignore()):(this._decoder.removeListener("box",n),t+=r.length,i.destroy(),this._decoder.destroy(),this._findMoov(e+t))};this._decoder.on("box",n)}_processMoov(e){const t=e.traks;this._tracks=[],this._hasVideo=!1,this._hasAudio=!1;for(let i=0;i=s.stsz.entries.length)break;if(f++,m+=e,f>=n.samplesPerChunk){f=0,m=0,h++;const e=s.stsc.entries[b+1];e&&h+1>=e.firstChunk&&b++}v+=t,g.inc(),y&&y.inc(),r&&_++}r.mdia.mdhd.duration=0,r.tkhd.duration=0;const x=n.sampleDescriptionId,w={type:"moov",mvhd:e.mvhd,traks:[{tkhd:r.tkhd,mdia:{mdhd:r.mdia.mdhd,hdlr:r.mdia.hdlr,elng:r.mdia.elng,minf:{vmhd:r.mdia.minf.vmhd,smhd:r.mdia.minf.smhd,dinf:r.mdia.minf.dinf,stbl:{stsd:s.stsd,stts:{version:0,flags:0,entries:[]},ctts:{version:0,flags:0,entries:[]},stsc:{version:0,flags:0,entries:[]},stsz:{version:0,flags:0,entries:[]},stco:{version:0,flags:0,entries:[]},stss:{version:0,flags:0,entries:[]}}}}}],mvex:{mehd:{fragmentDuration:e.mvhd.duration},trexs:[{trackId:r.tkhd.trackId,defaultSampleDescriptionIndex:x,defaultSampleDuration:0,defaultSampleSize:0,defaultSampleFlags:0}]}};this._tracks.push({fragmentSequence:1,trackId:r.tkhd.trackId,timeScale:r.mdia.mdhd.timeScale,samples:p,currSample:null,currTime:null,moov:w,mime:u})}if(0===this._tracks.length)return void this.emit("error",new Error("no playable tracks"));e.mvhd.duration=0,this._ftyp={type:"ftyp",brand:"iso5",brandVersion:0,compatibleBrands:["iso5"]};const r=a.encode(this._ftyp),s=this._tracks.map((e=>{const t=a.encode(e.moov);return{mime:e.mime,init:i.concat([r,t])}}));this.emit("ready",s)}seek(e){if(!this._tracks)throw new Error("Not ready yet; wait for 'ready' event");this._fileStream&&(this._fileStream.destroy(),this._fileStream=null);let t=-1;if(this._tracks.map(((i,n)=>{i.outStream&&i.outStream.destroy(),i.inStream&&(i.inStream.destroy(),i.inStream=null);const r=i.outStream=s.encode(),a=this._generateFragment(n,e);if(!a)return r.finalize();(-1===t||a.ranges[0].start{r.destroyed||r.box(e.moof,(t=>{if(t)return this.emit("error",t);if(r.destroyed)return;i.inStream.slice(e.ranges).pipe(r.mediaData(e.length,(e=>{if(e)return this.emit("error",e);if(r.destroyed)return;const t=this._generateFragment(n);if(!t)return r.finalize();o(t)})))}))};o(a)})),t>=0){const e=this._fileStream=this._file.createReadStream({start:t});this._tracks.forEach((i=>{i.inStream=new o(t,{highWaterMark:1e7}),e.pipe(i.inStream)}))}return this._tracks.map((e=>e.outStream))}_findSampleBefore(e,t){const i=this._tracks[e],r=Math.floor(i.timeScale*t);let s=n(i.samples,r,((e,t)=>e.dts+e.presentationOffset-t));for(-1===s?s=0:s<0&&(s=-s-2);!i.samples[s].sync;)s--;return s}_generateFragment(e,t){const i=this._tracks[e];let n;if(n=void 0!==t?this._findSampleBefore(e,t):i.currSample,n>=i.samples.length)return null;const r=i.samples[n].dts;let s=0;const a=[];for(var o=n;o=i.timeScale*l)break;s+=e.size;const t=a.length-1;t<0||a[t].end!==e.offset?a.push({start:e.offset,end:e.offset+e.size}):a[t].end+=e.size}return i.currSample=o,{moof:this._generateMoof(e,n,o),ranges:a,length:s}}_generateMoof(e,t,i){const n=this._tracks[e],r=[];let s=0;for(let e=t;e{this.detailedError=this._elemWrapper.detailedError,this.destroy()},this._onWaiting=()=>{this._waitingFired=!0,this._muxer?this._tracks&&this._pump():this._createMuxer()},t.autoplay&&(t.preload="auto"),t.addEventListener("waiting",this._onWaiting),t.addEventListener("error",this._onError)}a.prototype={_createMuxer(){this._muxer=new s(this._file),this._muxer.on("ready",(e=>{this._tracks=e.map((e=>{const t=this._elemWrapper.createWriteStream(e.mime);t.on("error",(e=>{this._elemWrapper.error(e)}));const i={muxed:null,mediaSource:t,initFlushed:!1,onInitFlushed:null};return t.write(e.init,(e=>{i.initFlushed=!0,i.onInitFlushed&&i.onInitFlushed(e)})),i})),(this._waitingFired||"auto"===this._elem.preload)&&this._pump()})),this._muxer.on("error",(e=>{this._elemWrapper.error(e)}))},_pump(){const e=this._muxer.seek(this._elem.currentTime,!this._tracks);this._tracks.forEach(((t,i)=>{const n=()=>{t.muxed&&(t.muxed.destroy(),t.mediaSource=this._elemWrapper.createWriteStream(t.mediaSource),t.mediaSource.on("error",(e=>{this._elemWrapper.error(e)}))),t.muxed=e[i],r(t.muxed,t.mediaSource)};t.initFlushed?n():t.onInitFlushed=e=>{e?this._elemWrapper.error(e):n()}}))},destroy(){this.destroyed||(this.destroyed=!0,this._elem.removeEventListener("waiting",this._onWaiting),this._elem.removeEventListener("error",this._onError),this._tracks&&this._tracks.forEach((e=>{e.muxed&&e.muxed.destroy()})),this._elem.src="")}},t.exports=a},{"./mp4-remuxer":486,mediasource:259,pump:349}],488:[function(e,t,i){(function(i){(function(){ /*! webtorrent. MIT License. WebTorrent LLC */ -const{EventEmitter:i}=e("events"),r=e("simple-concat"),s=e("create-torrent"),o=e("debug")("webtorrent"),a=e("bittorrent-dht/client"),c=e("load-ip-set"),u=e("run-parallel"),l=e("parse-torrent"),d=e("path"),f=e("simple-peer"),p=e("queue-microtask"),h=e("randombytes"),m=e("speedometer"),{ThrottleGroup:b}=e("speed-limiter"),g=e("./lib/conn-pool"),v=e("./lib/torrent"),y=e("./package.json").version,_=y.replace(/\d*./g,(e=>("0"+e%100).slice(-2))).slice(0,4),w=`-WW${_}-`;class x extends i{constructor(e={}){super(),"string"==typeof e.peerId?this.peerId=e.peerId:n.isBuffer(e.peerId)?this.peerId=e.peerId.toString("hex"):this.peerId=n.from(w+h(9).toString("base64")).toString("hex"),this.peerIdBuffer=n.from(this.peerId,"hex"),"string"==typeof e.nodeId?this.nodeId=e.nodeId:n.isBuffer(e.nodeId)?this.nodeId=e.nodeId.toString("hex"):this.nodeId=h(20).toString("hex"),this.nodeIdBuffer=n.from(this.nodeId,"hex"),this._debugId=this.peerId.toString("hex").substring(0,7),this.destroyed=!1,this.listening=!1,this.torrentPort=e.torrentPort||0,this.dhtPort=e.dhtPort||0,this.tracker=void 0!==e.tracker?e.tracker:{},this.lsd=!1!==e.lsd,this.torrents=[],this.maxConns=Number(e.maxConns)||55,this.utp=x.UTP_SUPPORT&&!1!==e.utp,this._downloadLimit=Math.max("number"==typeof e.downloadLimit?e.downloadLimit:-1,-1),this._uploadLimit=Math.max("number"==typeof e.uploadLimit?e.uploadLimit:-1,-1),this._debug("new webtorrent (peerId %s, nodeId %s, port %s)",this.peerId,this.nodeId,this.torrentPort),this.throttleGroups={down:new b({rate:Math.max(this._downloadLimit,0),enabled:this._downloadLimit>=0}),up:new b({rate:Math.max(this._uploadLimit,0),enabled:this._uploadLimit>=0})},this.tracker&&("object"!=typeof this.tracker&&(this.tracker={}),globalThis.WRTC&&!this.tracker.wrtc&&(this.tracker.wrtc=globalThis.WRTC)),"function"==typeof g?this._connPool=new g(this):p((()=>{this._onListening()})),this._downloadSpeed=m(),this._uploadSpeed=m(),!1!==e.dht&&"function"==typeof a?(this.dht=new a(Object.assign({},{nodeId:this.nodeId},e.dht)),this.dht.once("error",(e=>{this._destroy(e)})),this.dht.once("listening",(()=>{const e=this.dht.address();e&&(this.dhtPort=e.port)})),this.dht.setMaxListeners(0),this.dht.listen(this.dhtPort)):this.dht=!1,this.enableWebSeeds=!1!==e.webSeeds;const t=()=>{this.destroyed||(this.ready=!0,this.emit("ready"))};"function"==typeof c&&null!=e.blocklist?c(e.blocklist,{headers:{"user-agent":`WebTorrent/${y} (https://webtorrent.io)`}},((e,n)=>{if(e)return console.error(`Failed to load blocklist: ${e.message}`);this.blocked=n,t()})):p(t)}get downloadSpeed(){return this._downloadSpeed()}get uploadSpeed(){return this._uploadSpeed()}get progress(){const e=this.torrents.filter((e=>1!==e.progress));return e.reduce(((e,t)=>e+t.downloaded),0)/(e.reduce(((e,t)=>e+(t.length||0)),0)||1)}get ratio(){return this.torrents.reduce(((e,t)=>e+t.uploaded),0)/(this.torrents.reduce(((e,t)=>e+t.received),0)||1)}get(e){if(e instanceof v){if(this.torrents.includes(e))return e}else{let t;try{t=l(e)}catch(e){}if(!t)return null;if(!t.infoHash)throw new Error("Invalid torrent identifier");for(const e of this.torrents)if(e.infoHash===t.infoHash)return e}return null}add(e,t={},n=(()=>{})){if(this.destroyed)throw new Error("client is destroyed");"function"==typeof t&&([t,n]=[{},t]);const i=()=>{if(!this.destroyed)for(const e of this.torrents)if(e.infoHash===s.infoHash&&e!==s)return void s._destroy(new Error(`Cannot add duplicate torrent ${s.infoHash}`))},r=()=>{this.destroyed||(n(s),this.emit("torrent",s))};this._debug("add"),t=t?Object.assign({},t):{};const s=new v(e,this,t);return this.torrents.push(s),s.once("_infoHash",i),s.once("ready",r),s.once("close",(function e(){s.removeListener("_infoHash",i),s.removeListener("ready",r),s.removeListener("close",e)})),s}seed(e,t,n){if(this.destroyed)throw new Error("client is destroyed");"function"==typeof t&&([t,n]=[{},t]),this._debug("seed"),(t=t?Object.assign({},t):{}).skipVerify=!0;const i="string"==typeof e;i&&(t.path=d.dirname(e)),t.createdBy||(t.createdBy=`WebTorrent/${_}`);const o=e=>{this._debug("on seed"),"function"==typeof n&&n(e),e.emit("seed"),this.emit("seed",e)},a=this.add(null,t,(e=>{const n=[n=>{if(i||t.preloadedStore)return n();e.load(c,n)}];this.dht&&n.push((t=>{e.once("dhtAnnounce",t)})),u(n,(t=>{if(!this.destroyed)return t?e._destroy(t):void o(e)}))}));let c;var l;return l=e,"undefined"!=typeof FileList&&l instanceof FileList?e=Array.from(e):Array.isArray(e)||(e=[e]),u(e.map((e=>n=>{!t.preloadedStore&&function(e){return"object"==typeof e&&null!=e&&"function"==typeof e.pipe}(e)?r(e,((t,i)=>{if(t)return n(t);i.name=e.name,n(null,i)})):n(null,e)})),((e,n)=>{if(!this.destroyed)return e?a._destroy(e):void s.parseInput(n,t,((e,i)=>{if(!this.destroyed){if(e)return a._destroy(e);c=i.map((e=>e.getStream)),s(n,t,((e,t)=>{if(this.destroyed)return;if(e)return a._destroy(e);const n=this.get(t);n?a._destroy(new Error(`Cannot add duplicate torrent ${n.infoHash}`)):a._onTorrentId(t)}))}}))})),a}remove(e,t,n){if("function"==typeof t)return this.remove(e,null,t);this._debug("remove");if(!this.get(e))throw new Error(`No torrent with id ${e}`);this._remove(e,t,n)}_remove(e,t,n){if("function"==typeof t)return this._remove(e,null,t);const i=this.get(e);i&&(this.torrents.splice(this.torrents.indexOf(i),1),i.destroy(t,n))}address(){return this.listening?this._connPool?this._connPool.tcpServer.address():{address:"0.0.0.0",family:"IPv4",port:0}:null}throttleDownload(e){return e=Number(e),!(isNaN(e)||!isFinite(e)||e<-1)&&(this._downloadLimit=e,this._downloadLimit<0?this.throttleGroups.down.setEnabled(!1):(this.throttleGroups.down.setEnabled(!0),void this.throttleGroups.down.setRate(this._downloadLimit)))}throttleUpload(e){return e=Number(e),!(isNaN(e)||!isFinite(e)||e<-1)&&(this._uploadLimit=e,this._uploadLimit<0?this.throttleGroups.up.setEnabled(!1):(this.throttleGroups.up.setEnabled(!0),void this.throttleGroups.up.setRate(this._uploadLimit)))}destroy(e){if(this.destroyed)throw new Error("client already destroyed");this._destroy(null,e)}_destroy(e,t){this._debug("client destroy"),this.destroyed=!0;const n=this.torrents.map((e=>t=>{e.destroy(t)}));this._connPool&&n.push((e=>{this._connPool.destroy(e)})),this.dht&&n.push((e=>{this.dht.destroy(e)})),u(n,t),e&&this.emit("error",e),this.torrents=[],this._connPool=null,this.dht=null,this.throttleGroups.down.destroy(),this.throttleGroups.up.destroy()}_onListening(){if(this._debug("listening"),this.listening=!0,this._connPool){const e=this._connPool.tcpServer.address();e&&(this.torrentPort=e.port)}this.emit("listening")}_debug(){const e=[].slice.call(arguments);e[0]=`[${this._debugId}] ${e[0]}`,o(...e)}}x.WEBRTC_SUPPORT=f.WEBRTC_SUPPORT,x.UTP_SUPPORT=g.UTP_SUPPORT,x.VERSION=y,t.exports=x}).call(this)}).call(this,e("buffer").Buffer)},{"./lib/conn-pool":73,"./lib/torrent":508,"./package.json":528,"bittorrent-dht/client":73,buffer:116,"create-torrent":149,debug:510,events:196,"load-ip-set":73,"parse-torrent":333,path:334,"queue-microtask":355,randombytes:358,"run-parallel":384,"simple-concat":396,"simple-peer":398,"speed-limiter":438,speedometer:442}],504:[function(e,t,n){const i=e("debug")("webtorrent:file-stream"),r=e("readable-stream"),s=e("end-of-stream");class o extends r.Readable{constructor(e,t){super(t),this._torrent=e._torrent;const n=t&&t.start||0,i=t&&t.end&&t.end{this._notify()})),s(this,(e=>{this.destroy(e)}))}_read(){this._reading||(this._reading=!0,this._notify())}_notify(){if(!this._reading||0===this._missing)return;if(!this._torrent.bitfield.get(this._piece))return this._torrent.critical(this._piece,this._piece+this._criticalLength);if(this._notifying)return;if(this._notifying=!0,this._torrent.destroyed)return this.destroy(new Error("Torrent removed"));const e=this._piece,t={};e===this._torrent.pieces.length-1&&(t.length=this._torrent.lastPieceLength),this._torrent.store.get(e,t,((t,n)=>{if(this._notifying=!1,!this.destroyed){if(i("read %s (length %s) (err %s)",e,n&&n.length,t&&t.message),t)return this.destroy(t);this._offset&&(n=n.slice(this._offset),this._offset=0),this._missing{const s=r===e.length-1?i:n;return t.get(r)?s:s-e[r].missing};let a=0;for(let t=r;t<=s;t+=1){const c=o(t);if(a+=c,t===r){const e=this.offset%n;a-=Math.min(e,c)}if(t===s){const t=(s===e.length-1?i:n)-(this.offset+this.length)%n;a-=Math.min(t,c)}}return a}get progress(){return this.length?this.downloaded/this.length:0}select(e){0!==this.length&&this._torrent.select(this._startPiece,this._endPiece,e)}deselect(){0!==this.length&&this._torrent.deselect(this._startPiece,this._endPiece,!1)}createReadStream(e){if(0===this.length){const e=new r;return d((()=>{e.end()})),e}const t=new l(this,e);return this._fileStreams.add(t),t.once("close",(()=>{this._fileStreams.delete(t)})),t}getBuffer(e){u(this.createReadStream(),this.length,e)}getBlob(e){if("undefined"==typeof window)throw new Error("browser-only method");a(this.createReadStream(),this._getMimeType()).then((t=>e(null,t)),(t=>e(t)))}getBlobURL(e){if("undefined"==typeof window)throw new Error("browser-only method");c(this.createReadStream(),this._getMimeType()).then((t=>e(null,t)),(t=>e(t)))}appendTo(e,t,n){if("undefined"==typeof window)throw new Error("browser-only method");o.append(this,e,t,n)}renderTo(e,t,n){if("undefined"==typeof window)throw new Error("browser-only method");o.render(this,e,t,n)}_getMimeType(){return o.mime[s.extname(this.name).toLowerCase()]}_destroy(){this._destroyed=!0,this._torrent=null;for(const e of this._fileStreams)e.destroy();this._fileStreams.clear()}}},{"./file-stream":504,events:196,path:334,"queue-microtask":355,"readable-stream":527,"render-media":377,"stream-to-blob":478,"stream-to-blob-url":477,"stream-with-known-length-to-buffer":479}],506:[function(e,t,n){const{EventEmitter:i}=e("events"),{Transform:r}=e("stream"),s=e("unordered-array-remove"),o=e("debug")("webtorrent:peer"),a=e("bittorrent-protocol");n.createWebRTCPeer=(e,t,n)=>{const i=new l(e.id,"webrtc");if(i.conn=e,i.swarm=t,i.throttleGroups=n,i.conn.connected)i.onConnect();else{const e=()=>{i.conn.removeListener("connect",t),i.conn.removeListener("error",n)},t=()=>{e(),i.onConnect()},n=t=>{e(),i.destroy(t)};i.conn.once("connect",t),i.conn.once("error",n),i.startConnectTimeout()}return i},n.createTCPIncomingPeer=(e,t)=>c(e,"tcpIncoming",t),n.createUTPIncomingPeer=(e,t)=>c(e,"utpIncoming",t),n.createTCPOutgoingPeer=(e,t,n)=>u(e,t,"tcpOutgoing",n),n.createUTPOutgoingPeer=(e,t,n)=>u(e,t,"utpOutgoing",n);const c=(e,t,n)=>{const i=`${e.remoteAddress}:${e.remotePort}`,r=new l(i,t);return r.conn=e,r.addr=i,r.throttleGroups=n,r.onConnect(),r},u=(e,t,n,i)=>{const r=new l(e,n);return r.addr=e,r.swarm=t,r.throttleGroups=i,r};n.createWebSeedPeer=(e,t,n,i)=>{const r=new l(t,"webSeed");return r.swarm=n,r.conn=e,r.throttleGroups=i,r.onConnect(),r};class l extends i{constructor(e,t){super(),this.id=e,this.type=t,o("new %s Peer %s",t,e),this.addr=null,this.conn=null,this.swarm=null,this.wire=null,this.connected=!1,this.destroyed=!1,this.timeout=null,this.retries=0,this.sentHandshake=!1}onConnect(){if(this.destroyed)return;this.connected=!0,o("Peer %s connected",this.id),clearTimeout(this.connectTimeout);const e=this.conn;e.once("end",(()=>{this.destroy()})),e.once("close",(()=>{this.destroy()})),e.once("finish",(()=>{this.destroy()})),e.once("error",(e=>{this.destroy(e)}));const t=this.wire=new a;t.type=this.type,t.once("end",(()=>{this.destroy()})),t.once("close",(()=>{this.destroy()})),t.once("finish",(()=>{this.destroy()})),t.once("error",(e=>{this.destroy(e)})),t.once("handshake",((e,t)=>{this.onHandshake(e,t)})),this.startHandshakeTimeout(),this.setThrottlePipes(),this.swarm&&!this.sentHandshake&&this.handshake()}clearPipes(){this.conn.unpipe(),this.wire.unpipe()}setThrottlePipes(){const e=this;this.conn.pipe(this.throttleGroups.down.throttle()).pipe(new r({transform(t,n,i){e.emit("download",t.length),e.destroyed||i(null,t)}})).pipe(this.wire).pipe(this.throttleGroups.up.throttle()).pipe(new r({transform(t,n,i){e.emit("upload",t.length),e.destroyed||i(null,t)}})).pipe(this.conn)}onHandshake(e,t){if(!this.swarm)return;if(this.destroyed)return;if(this.swarm.destroyed)return this.destroy(new Error("swarm already destroyed"));if(e!==this.swarm.infoHash)return this.destroy(new Error("unexpected handshake info hash for this swarm"));if(t===this.swarm.peerId)return this.destroy(new Error("refusing to connect to ourselves"));o("Peer %s got handshake %s",this.id,e),clearTimeout(this.handshakeTimeout),this.retries=0;let n=this.addr;!n&&this.conn.remoteAddress&&this.conn.remotePort&&(n=`${this.conn.remoteAddress}:${this.conn.remotePort}`),this.swarm._onWire(this.wire,n),this.swarm&&!this.swarm.destroyed&&(this.sentHandshake||this.handshake())}handshake(){const e={dht:!this.swarm.private&&!!this.swarm.client.dht};this.wire.handshake(this.swarm.infoHash,this.swarm.client.peerId,e),this.sentHandshake=!0}startConnectTimeout(){clearTimeout(this.connectTimeout);const e={webrtc:25e3,tcpOutgoing:5e3,utpOutgoing:5e3};this.connectTimeout=setTimeout((()=>{this.destroy(new Error("connect timeout"))}),e[this.type]),this.connectTimeout.unref&&this.connectTimeout.unref()}startHandshakeTimeout(){clearTimeout(this.handshakeTimeout),this.handshakeTimeout=setTimeout((()=>{this.destroy(new Error("handshake timeout"))}),25e3),this.handshakeTimeout.unref&&this.handshakeTimeout.unref()}destroy(e){if(this.destroyed)return;this.destroyed=!0,this.connected=!1,o("destroy %s %s (error: %s)",this.type,this.id,e&&(e.message||e)),clearTimeout(this.connectTimeout),clearTimeout(this.handshakeTimeout);const t=this.swarm,n=this.conn,i=this.wire;this.swarm=null,this.conn=null,this.wire=null,t&&i&&s(t.wires,t.wires.indexOf(i)),n&&(n.on("error",(()=>{})),n.destroy()),i&&i.destroy(),t&&t.removePeer(this.id)}}},{"bittorrent-protocol":28,debug:510,events:196,stream:443,"unordered-array-remove":493}],507:[function(e,t,n){t.exports=class{constructor(e){this._torrent=e,this._numPieces=e.pieces.length,this._pieces=new Array(this._numPieces),this._onWire=e=>{this.recalculate(),this._initWire(e)},this._onWireHave=e=>{this._pieces[e]+=1},this._onWireBitfield=()=>{this.recalculate()},this._torrent.wires.forEach((e=>{this._initWire(e)})),this._torrent.on("wire",this._onWire),this.recalculate()}getRarestPiece(e){let t=[],n=1/0;for(let i=0;i{this._cleanupWireEvents(e)})),this._torrent=null,this._pieces=null,this._onWire=null,this._onWireHave=null,this._onWireBitfield=null}_initWire(e){e._onClose=()=>{this._cleanupWireEvents(e);for(let t=0;t{this.destroyed||this._onParsedTorrent(t)}))):k.remote(e,((e,t)=>{if(!this.destroyed)return e?this._destroy(e):void this._onParsedTorrent(t)}))}_onParsedTorrent(e){if(!this.destroyed){if(this._processParsedTorrent(e),!this.infoHash)return this._destroy(new Error("Malformed torrent data: No info hash"));this.path||(this.path=E.join(W,this.infoHash)),this._rechokeIntervalId=setInterval((()=>{this._rechoke()}),1e4),this._rechokeIntervalId.unref&&this._rechokeIntervalId.unref(),this.emit("_infoHash",this.infoHash),this.destroyed||(this.emit("infoHash",this.infoHash),this.destroyed||(this.client.listening?this._onListening():this.client.once("listening",(()=>{this._onListening()}))))}}_processParsedTorrent(e){this._debugId=e.infoHash.toString("hex").substring(0,7),void 0!==this.private&&(e.private=this.private),this.announce&&(e.announce=e.announce.concat(this.announce)),this.client.tracker&&i.WEBTORRENT_ANNOUNCE&&!e.private&&(e.announce=e.announce.concat(i.WEBTORRENT_ANNOUNCE)),this.urlList&&(e.urlList=e.urlList.concat(this.urlList)),e.announce=Array.from(new Set(e.announce)),e.urlList=Array.from(new Set(e.urlList)),Object.assign(this,e),this.magnetURI=k.toMagnetURI(e),this.torrentFile=k.toTorrentFile(e)}_onListening(){this.destroyed||(this.info?this._onMetadata(this):(this.xs&&this._getMetadataFromServer(),this._startDiscovery()))}_startDiscovery(){if(this.discovery||this.destroyed)return;let e=this.client.tracker;e&&(e=Object.assign({},this.client.tracker,{getAnnounceOpts:()=>{if(this.destroyed)return;const e={uploaded:this.uploaded,downloaded:this.downloaded,left:Math.max(this.length-this.downloaded,0)};return this.client.tracker.getAnnounceOpts&&Object.assign(e,this.client.tracker.getAnnounceOpts()),this._getAnnounceOpts&&Object.assign(e,this._getAnnounceOpts()),e}})),this.peerAddresses&&this.peerAddresses.forEach((e=>this.addPeer(e))),this.discovery=new l({infoHash:this.infoHash,announce:this.announce,peerId:this.client.peerId,dht:!this.private&&this.client.dht,tracker:e,port:this.client.torrentPort,userAgent:F,lsd:this.client.lsd}),this.discovery.on("error",(e=>{this._destroy(e)})),this.discovery.on("peer",((e,t)=>{this._debug("peer %s discovered via %s",e,t),"string"==typeof e&&this.done||this.addPeer(e)})),this.discovery.on("trackerAnnounce",(()=>{this.emit("trackerAnnounce"),0===this.numPeers&&this.emit("noPeers","tracker")})),this.discovery.on("dhtAnnounce",(()=>{this.emit("dhtAnnounce"),0===this.numPeers&&this.emit("noPeers","dht")})),this.discovery.on("warning",(e=>{this.emit("warning",e)}))}_getMetadataFromServer(){const e=this,t=(Array.isArray(this.xs)?this.xs:[this.xs]).map((t=>n=>{!function(t,n){if(0!==t.indexOf("http://")&&0!==t.indexOf("https://"))return e.emit("warning",new Error(`skipping non-http xs param: ${t}`)),n(null);const i={url:t,method:"GET",headers:{"user-agent":F}};let r;try{r=h.concat(i,s)}catch(i){return e.emit("warning",new Error(`skipping invalid url xs param: ${t}`)),n(null)}function s(i,r,s){if(e.destroyed)return n(null);if(e.metadata)return n(null);if(i)return e.emit("warning",new Error(`http error from xs param: ${t}`)),n(null);if(200!==r.statusCode)return e.emit("warning",new Error(`non-200 status code ${r.statusCode} from xs param: ${t}`)),n(null);let o;try{o=k(s)}catch(i){}return o?o.infoHash!==e.infoHash?(e.emit("warning",new Error(`got torrent file with incorrect info hash from xs param: ${t}`)),n(null)):(e._onMetadata(o),void n(null)):(e.emit("warning",new Error(`got invalid torrent file from xs param: ${t}`)),n(null))}e._xsRequests.push(r)}(t,n)}));w(t)}_onMetadata(e){if(this.metadata||this.destroyed)return;let t;if(this._debug("got metadata"),this._xsRequests.forEach((e=>{e.abort()})),this._xsRequests=[],e&&e.infoHash)t=e;else try{t=k(e)}catch(e){return this._destroy(e)}this._processParsedTorrent(t),this.metadata=this.torrentFile,this.client.enableWebSeeds&&this.urlList.forEach((e=>{this.addWebSeed(e)})),this._rarityMap=new O(this);let n=this._preloadedStore;if(n||(n=new this._store(this.pieceLength,{torrent:{infoHash:this.infoHash},files:this.files.map((e=>({path:E.join(this.path,e.path),length:e.length,offset:e.offset}))),length:this.length,name:this.infoHash})),this._storeCacheSlots>0&&!(n instanceof g)&&(n=new o(n,{max:this._storeCacheSlots})),this.store=new m(n),this.files=this.files.map((e=>new R(this,e))),this.so?this.files.forEach(((e,t)=>{this.so.includes(t)?this.files[t].select():this.files[t].deselect()})):0!==this.pieces.length&&this.select(0,this.pieces.length-1,!1),this._hashes=this.pieces,this.pieces=this.pieces.map(((e,t)=>{const n=t===this.pieces.length-1?this.lastPieceLength:this.pieceLength;return new S(n)})),this._reservations=this.pieces.map((()=>[])),this.bitfield=new s(this.pieces.length),this.wires.forEach((e=>{e.ut_metadata&&e.ut_metadata.setMetadata(this.metadata),this._onWireWithMetadata(e)})),this.emit("metadata"),!this.destroyed)if(this.skipVerify)this._markAllVerified(),this._onStore();else{const e=e=>{if(e)return this._destroy(e);this._debug("done verifying"),this._onStore()};this._debug("verifying existing torrent data"),this._fileModtimes&&this._store===p?this.getFileModtimes(((t,n)=>{if(t)return this._destroy(t);this.files.map(((e,t)=>n[t]===this._fileModtimes[t])).every((e=>e))?(this._markAllVerified(),this._onStore()):this._verifyPieces(e)})):this._verifyPieces(e)}}getFileModtimes(e){const t=[];x(this.files.map(((e,n)=>i=>{f.stat(E.join(this.path,e.path),((e,r)=>{if(e&&"ENOENT"!==e.code)return i(e);t[n]=r&&r.mtime.getTime(),i(null)}))})),z,(n=>{this._debug("done getting file modtimes"),e(n,t)}))}_verifyPieces(e){x(this.pieces.map(((e,t)=>e=>{if(this.destroyed)return e(new Error("torrent is destroyed"));const n={};t===this.pieces.length-1&&(n.length=this.lastPieceLength),this.store.get(t,n,((n,i)=>this.destroyed?e(new Error("torrent is destroyed")):n?A((()=>e(null))):void T(i,(n=>{if(this.destroyed)return e(new Error("torrent is destroyed"));n===this._hashes[t]?(this._debug("piece verified %s",t),this._markVerified(t)):this._debug("piece invalid %s",t),e(null)}))))})),z,e)}rescanFiles(e){if(this.destroyed)throw new Error("torrent is destroyed");e||(e=K),this._verifyPieces((t=>{if(t)return this._destroy(t),e(t);this._checkDone(),e(null)}))}_markAllVerified(){for(let e=0;e{e.abort()})),this._rarityMap&&this._rarityMap.destroy();for(const e in this._peers)this.removePeer(e);this.files.forEach((e=>{e instanceof R&&e._destroy()}));const i=this._servers.map((e=>t=>{e.destroy(t)}));if(this.discovery&&i.push((e=>{this.discovery.destroy(e)})),this.store){let e=this._destroyStoreOnDestroy;t&&void 0!==t.destroyStore&&(e=t.destroyStore),i.push((t=>{e?this.store.destroy(t):this.store.close(t)}))}w(i,n),e&&(0===this.listenerCount("error")?this.client.emit("error",e):this.emit("error",e)),this.emit("close"),this.client=null,this.files=[],this.discovery=null,this.store=null,this._rarityMap=null,this._peers=null,this._servers=null,this._xsRequests=null}addPeer(e){if(this.destroyed)throw new Error("torrent is destroyed");if(!this.infoHash)throw new Error("addPeer() must not be called before the `infoHash` event");let t;if(this.client.blocked){if("string"==typeof e){let n;try{n=r(e)}catch(t){return this._debug("ignoring peer: invalid %s",e),this.emit("invalidPeer",e),!1}t=n[0]}else"string"==typeof e.remoteAddress&&(t=e.remoteAddress);if(t&&this.client.blocked.contains(t))return this._debug("ignoring peer: blocked %s",e),"string"!=typeof e&&e.destroy(),this.emit("blockedPeer",e),!1}const n=this.client.utp&&this._isIPv4(t)?"utp":"tcp",i=!!this._addPeer(e,n);return i?this.emit("peer",e):this.emit("invalidPeer",e),i}_addPeer(e,t){if(this.destroyed)return"string"!=typeof e&&e.destroy(),null;if("string"==typeof e&&!this._validAddr(e))return this._debug("ignoring peer: invalid %s",e),null;const n=e&&e.id||e;if(this._peers[n])return this._debug("ignoring peer: duplicate (%s)",n),"string"!=typeof e&&e.destroy(),null;if(this.paused)return this._debug("ignoring peer: torrent is paused"),"string"!=typeof e&&e.destroy(),null;let i;return this._debug("add peer %s",n),i="string"==typeof e?"utp"===t?L.createUTPOutgoingPeer(e,this,this.client.throttleGroups):L.createTCPOutgoingPeer(e,this,this.client.throttleGroups):L.createWebRTCPeer(e,this,this.client.throttleGroups),this._registerPeer(i),"string"==typeof e&&(this._queue.push(i),this._drain()),i}addWebSeed(e){if(this.destroyed)throw new Error("torrent is destroyed");let t,n;if("string"==typeof e){if(t=e,!/^https?:\/\/.+/.test(t))return this.emit("warning",new Error(`ignoring invalid web seed: ${t}`)),void this.emit("invalidPeer",t);if(this._peers[t])return this.emit("warning",new Error(`ignoring duplicate web seed: ${t}`)),void this.emit("invalidPeer",t);n=new q(t,this)}else{if(!e||"string"!=typeof e.connId)return void this.emit("warning",new Error("addWebSeed must be passed a string or connection object with id property"));if(n=e,t=n.connId,this._peers[t])return this.emit("warning",new Error(`ignoring duplicate web seed: ${t}`)),void this.emit("invalidPeer",t)}this._debug("add web seed %s",t);const i=L.createWebSeedPeer(n,t,this,this.client.throttleGroups);this._registerPeer(i),this.emit("peer",t)}_addIncomingPeer(e){return this.destroyed?e.destroy(new Error("torrent is destroyed")):this.paused?e.destroy(new Error("torrent is paused")):(this._debug("add incoming peer %s",e.id),void this._registerPeer(e))}_registerPeer(e){e.on("download",(e=>{this.destroyed||(this.received+=e,this._downloadSpeed(e),this.client._downloadSpeed(e),this.emit("download",e),this.destroyed||this.client.emit("download",e))})),e.on("upload",(e=>{this.destroyed||(this.uploaded+=e,this._uploadSpeed(e),this.client._uploadSpeed(e),this.emit("upload",e),this.destroyed||this.client.emit("upload",e))})),this._peers[e.id]=e,this._peersLength+=1}removePeer(e){const t=e&&e.id||e;(e=this._peers[t])&&(this._debug("removePeer %s",t),delete this._peers[t],this._peersLength-=1,e.destroy(),this._drain())}select(e,t,n,i){if(this.destroyed)throw new Error("torrent is destroyed");if(e<0||tt.priority-e.priority)),this._updateSelections()}deselect(e,t,n){if(this.destroyed)throw new Error("torrent is destroyed");n=Number(n)||0,this._debug("deselect %s-%s (priority %s)",e,t,n);for(let i=0;i{if(!this.destroyed&&!this.client.dht.destroyed){if(!e.remoteAddress)return this._debug("ignoring PORT from peer with no address");if(0===n||n>65536)return this._debug("ignoring invalid PORT from peer");this._debug("port: %s (from %s)",n,t),this.client.dht.addNode({host:e.remoteAddress,port:n})}})),e.on("timeout",(()=>{this._debug("wire timeout (%s)",t),e.destroy()})),"webSeed"!==e.type&&e.setTimeout(3e4,!0),e.setKeepAlive(!0),e.use(C(this.metadata)),e.ut_metadata.on("warning",(e=>{this._debug("ut_metadata warning: %s",e.message)})),this.metadata||(e.ut_metadata.on("metadata",(e=>{this._debug("got metadata via ut_metadata"),this._onMetadata(e)})),e.ut_metadata.fetch()),"function"!=typeof B||this.private||(e.use(B()),e.ut_pex.on("peer",(e=>{this.done||(this._debug("ut_pex: got peer: %s (from %s)",e,t),this.addPeer(e))})),e.ut_pex.on("dropped",(e=>{const n=this._peers[e];n&&!n.connected&&(this._debug("ut_pex: dropped peer: %s (from %s)",e,t),this.removePeer(e))})),e.once("close",(()=>{e.ut_pex.reset()}))),e.use(b()),this.emit("wire",e,t),this.metadata&&A((()=>{this._onWireWithMetadata(e)}))}_onWireWithMetadata(e){let t=null;const n=()=>{this.destroyed||e.destroyed||(this._numQueued>2*(this._numConns-this.numPeers)&&e.amInterested?e.destroy():(t=setTimeout(n,N),t.unref&&t.unref()))};let i;const r=()=>{if(e.peerPieces.buffer.length===this.bitfield.buffer.length){for(i=0;i{r(),this._update(),this._updateWireInterest(e)})),e.on("have",(()=>{r(),this._update(),this._updateWireInterest(e)})),e.lt_donthave.on("donthave",(()=>{r(),this._update(),this._updateWireInterest(e)})),e.once("interested",(()=>{e.unchoke()})),e.once("close",(()=>{clearTimeout(t)})),e.on("choke",(()=>{clearTimeout(t),t=setTimeout(n,N),t.unref&&t.unref()})),e.on("unchoke",(()=>{clearTimeout(t),this._update()})),e.on("request",((t,n,i,r)=>{if(i>131072)return e.destroy();this.pieces[t]||this.store.get(t,{offset:n,length:i},r)})),e.bitfield(this.bitfield),this._updateWireInterest(e),e.peerExtensions.dht&&this.client.dht&&this.client.dht.listening&&e.port(this.client.dht.address().port),"webSeed"!==e.type&&(t=setTimeout(n,N),t.unref&&t.unref()),e.isSeeder=!1,r()}_updateSelections(){this.ready&&!this.destroyed&&(A((()=>{this._gcSelections()})),this._updateInterest(),this._update())}_gcSelections(){for(let e=0;ethis._updateWireInterest(e))),e!==this._amInterested&&(this._amInterested?this.emit("interested"):this.emit("uninterested"))}_updateWireInterest(e){let t=!1;for(let n=0;n{t._updateWire(e)}),{timeout:250}):t._updateWire(e)}_updateWire(e){const t=this;if(e.peerChoking)return;if(!e.downloaded)return function(){if(e.requests.length)return;let n=t._selections.length;for(;n--;){const i=t._selections[n];let s;if("rarest"===t.strategy){const n=i.from+i.offset,o=i.to,a=o-n+1,c={};let u=0;const l=r(n,o,c);for(;u=i.from+i.offset;--s)if(e.peerPieces.get(s)&&t._request(e,s,!1))return}}();const n=V(e,.5);if(e.requests.length>=n)return;const i=V(e,1);function r(t,n,i,r){return s=>s>=t&&s<=n&&!(s in i)&&e.peerPieces.get(s)&&(!r||r(s))}function s(e){let n=e;for(let i=e;i=i)return!0;const o=function(){const n=e.downloadSpeed()||1;if(n>D)return()=>!0;const i=Math.max(1,e.requests.length)*S.BLOCK_LENGTH/n;let r=10,s=0;return e=>{if(!r||t.bitfield.get(e))return!0;let o=t.pieces[e].missing;for(;s0))return r--,!1}return!0}}();for(let a=0;a({wire:e,random:Math.random()}))).sort(((e,t)=>{const n=e.wire,i=t.wire;return n.downloadSpeed()!==i.downloadSpeed()?n.downloadSpeed()-i.downloadSpeed():n.uploadSpeed()!==i.uploadSpeed()?n.uploadSpeed()-i.uploadSpeed():n.amChoking!==i.amChoking?n.amChoking?-1:1:e.random-t.random})).map((e=>e.wire));this._rechokeOptimisticTime<=0?this._rechokeOptimisticWire=null:this._rechokeOptimisticTime-=1;let t=0;for(;e.length>0&&t0){const t=e.filter((e=>e.peerInterested));if(t.length>0){const e=t[(n=t.length,Math.random()*n|0)];e.unchoke(),this._rechokeOptimisticWire=e,this._rechokeOptimisticTime=2}}var n;e.filter((e=>e!==this._rechokeOptimisticWire)).forEach((e=>e.choke()))}_hotswap(e,t){const n=e.downloadSpeed();if(n=D||(2*a>n||a>o||(r=t,o=a))}if(!r)return!1;for(s=0;s=(s?Math.min(function(e,t,n){return 1+Math.ceil(t*e.downloadSpeed()/n)}(e,1,i.pieceLength),i.maxWebConns):V(e,1)))return!1;const o=i.pieces[t];let a=s?o.reserveRemaining():o.reserve();if(-1===a&&n&&i._hotswap(e,t)&&(a=s?o.reserveRemaining():o.reserve()),-1===a)return!1;let c=i._reservations[t];c||(c=i._reservations[t]=[]);let u=c.indexOf(null);-1===u&&(u=c.length),c[u]=e;const l=o.chunkOffset(a),d=s?o.chunkLengthRemaining(a):o.chunkLength(a);function f(){A((()=>{i._update()}))}return e.request(t,l,d,(function n(r,p){if(i.destroyed)return;if(!i.ready)return i.once("ready",(()=>{n(r,p)}));if(c[u]===e&&(c[u]=null),o!==i.pieces[t])return f();if(r)return i._debug("error getting piece %s (offset: %s length: %s) from %s: %s",t,l,d,`${e.remoteAddress}:${e.remotePort}`,r.message),s?o.cancelRemaining(a):o.cancel(a),void f();if(i._debug("got piece %s (offset: %s length: %s) from %s",t,l,d,`${e.remoteAddress}:${e.remotePort}`),!o.set(a,p,e))return f();const h=o.flush();T(h,(e=>{i.destroyed||(e===i._hashes[t]?(i._debug("piece verified %s",t),i.store.put(t,h,(e=>{e?i._destroy(e):(i.pieces[t]=null,i._markVerified(t),i.wires.forEach((e=>{e.have(t)})),i._checkDone()&&!i.destroyed&&i.discovery.complete(),f())}))):(i.pieces[t]=new S(o.length),i.emit("warning",new Error(`Piece ${t} failed verification`)),f()))}))})),!0}_checkDone(){if(this.destroyed)return;this.files.forEach((e=>{if(!e.done){for(let t=e._startPiece;t<=e._endPiece;++t)if(!this.bitfield.get(t))return;e.done=!0,e.emit("done"),this._debug(`file done: ${e.name}`)}}));let e=!0;for(const t of this._selections){for(let n=t.from;n<=t.to;n++)if(!this.bitfield.get(n)){e=!1;break}if(!e)break}return!this.done&&e&&(this.done=!0,this._debug(`torrent done: ${this.infoHash}`),this.emit("done")),this._gcSelections(),e}load(e,t){if(this.destroyed)throw new Error("torrent is destroyed");if(!this.ready)return this.once("ready",(()=>{this.load(e,t)}));Array.isArray(e)||(e=[e]),t||(t=K);const n=new v(e),i=new a(this.store,this.pieceLength);M(n,i,(e=>{if(e)return t(e);this._markAllVerified(),this._checkDone(),t(null)}))}createServer(e){if("function"!=typeof P)throw new Error("node.js-only method");if(this.destroyed)throw new Error("torrent is destroyed");const t=new P(this,e);return this._servers.push(t),t}pause(){this.destroyed||(this._debug("pause"),this.paused=!0)}resume(){this.destroyed||(this._debug("resume"),this.paused=!1,this._drain())}_debug(){const e=[].slice.call(arguments);e[0]=`[${this.client?this.client._debugId:"No Client"}] [${this._debugId}] ${e[0]}`,u(...e)}_drain(){if(this._debug("_drain numConns %s maxConns %s",this._numConns,this.client.maxConns),"function"!=typeof y.connect||this.destroyed||this.paused||this._numConns>=this.client.maxConns)return;this._debug("drain (%s queued, %s/%s peers)",this._numQueued,this.numPeers,this.client.maxConns);const e=this._queue.shift();if(!e)return;this._debug("%s connect attempt to %s",e.type,e.addr);const t=r(e.addr),n={host:t[0],port:t[1]};this.client.utp&&"utpOutgoing"===e.type?e.conn=U.connect(n.port,n.host):e.conn=y.connect(n);const i=e.conn;i.once("connect",(()=>{e.onConnect()})),i.once("error",(t=>{e.destroy(t)})),e.startConnectTimeout(),i.on("close",(()=>{if(this.destroyed)return;if(e.retries>=H.length){if(this.client.utp){const t=this._addPeer(e.addr,"tcp");t&&(t.retries=0)}else this._debug("conn %s closed: will not re-add (max %s attempts)",e.addr,H.length);return}const t=H[e.retries];this._debug("conn %s closed: will re-add to queue in %sms (attempt %s)",e.addr,t,e.retries+1);const n=setTimeout((()=>{if(this.destroyed)return;const t=r(e.addr)[0],n=this.client.utp&&this._isIPv4(t)?"utp":"tcp",i=this._addPeer(e.addr,n);i&&(i.retries=e.retries+1)}),t);n.unref&&n.unref()}))}_validAddr(e){let t;try{t=r(e)}catch(e){return!1}const n=t[0],i=t[1];return i>0&&i<65535&&!("127.0.0.1"===n&&i===this.client.torrentPort)}_isIPv4(e){return/^((?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])[.]){3}(?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])$/.test(e)}}}).call(this)}).call(this,e("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../package.json":528,"./file":505,"./peer":506,"./rarity-map":507,"./server":73,"./utp":73,"./webconn":509,_process:342,"addr-to-ip-port":3,bitfield:27,"cache-chunk-store":123,"chunk-store-stream/write":139,cpus:142,debug:510,events:196,fs:73,"fs-chunk-store":281,"immediate-chunk-store":248,lt_donthave:259,"memory-chunk-store":281,multistream:310,net:73,os:73,"parse-torrent":333,path:334,pump:350,"queue-microtask":355,"random-iterate":357,"run-parallel":384,"run-parallel-limit":383,"simple-get":397,"simple-sha1":417,speedometer:442,"torrent-discovery":486,"torrent-piece":490,ut_metadata:496,ut_pex:73}],509:[function(e,t,n){(function(n){(function(){const i=e("bitfield").default,r=e("debug")("webtorrent:webconn"),s=e("simple-get"),o=e("lt_donthave"),a=e("simple-sha1"),c=e("bittorrent-protocol"),u=e("../package.json").version;t.exports=class extends c{constructor(e,t){super(),this.url=e,this.connId=e,this.webPeerId=a.sync(e),this._torrent=t,this._init()}_init(){this.setKeepAlive(!0),this.use(o()),this.once("handshake",((e,t)=>{if(this.destroyed)return;this.handshake(e,this.webPeerId);const n=this._torrent.pieces.length,r=new i(n);for(let e=0;e<=n;e++)r.set(e,!0);this.bitfield(r)})),this.once("interested",(()=>{r("interested"),this.unchoke()})),this.on("uninterested",(()=>{r("uninterested")})),this.on("choke",(()=>{r("choke")})),this.on("unchoke",(()=>{r("unchoke")})),this.on("bitfield",(()=>{r("bitfield")})),this.lt_donthave.on("donthave",(()=>{r("donthave")})),this.on("request",((e,t,n,i)=>{r("request pieceIndex=%d offset=%d length=%d",e,t,n),this.httpRequest(e,t,n,((t,n)=>{if(t){this.lt_donthave.donthave(e);const t=setTimeout((()=>{this.destroyed||this.have(e)}),1e4);t.unref&&t.unref()}i(t,n)}))}))}httpRequest(e,t,i,o){const a=e*this._torrent.pieceLength+t,c=a+i-1,l=this._torrent.files;let d;if(l.length<=1)d=[{url:this.url,start:a,end:c}];else{const e=l.filter((e=>e.offset<=c&&e.offset+e.length>a));if(e.length<1)return o(new Error("Could not find file corresponding to web seed range request"));d=e.map((e=>{const t=e.offset+e.length-1;return{url:this.url+("/"===this.url[this.url.length-1]?"":"/")+e.path,fileOffsetInRange:Math.max(e.offset-a,0),start:Math.max(a-e.offset,0),end:Math.min(t,c-e.offset)}}))}let f,p=0,h=!1;d.length>1&&(f=n.alloc(i)),d.forEach((n=>{const a=n.url,c=n.start,l=n.end;r("Requesting url=%s pieceIndex=%d offset=%d length=%d start=%d end=%d",a,e,t,i,c,l);const m={url:a,method:"GET",headers:{"user-agent":`WebTorrent/${u} (https://webtorrent.io)`,range:`bytes=${c}-${l}`},timeout:6e4};function b(e,t){if(e.statusCode<200||e.statusCode>=300){if(h)return;return h=!0,o(new Error(`Unexpected HTTP status code ${e.statusCode}`))}r("Got data of length %d",t.length),1===d.length?o(null,t):(t.copy(f,n.fileOffsetInRange),++p===d.length&&o(null,f))}s.concat(m,((e,t,n)=>{if(!h)return e?"undefined"==typeof window||a.startsWith(`${window.location.origin}/`)?(h=!0,o(e)):s.head(a,((t,n)=>{if(!h){if(t)return h=!0,o(t);if(n.statusCode<200||n.statusCode>=300)return h=!0,o(new Error(`Unexpected HTTP status code ${n.statusCode}`));if(n.url===a)return h=!0,o(e);m.url=n.url,s.concat(m,((e,t,n)=>{if(!h)return e?(h=!0,o(e)):void b(t,n)}))}})):void b(t,n)}))}))}destroy(){super.destroy(),this._torrent=null}}}).call(this)}).call(this,e("buffer").Buffer)},{"../package.json":528,bitfield:27,"bittorrent-protocol":28,buffer:116,debug:510,lt_donthave:259,"simple-get":397,"simple-sha1":417}],510:[function(e,t,n){arguments[4][29][0].apply(n,arguments)},{"./common":511,_process:342,dup:29}],511:[function(e,t,n){arguments[4][30][0].apply(n,arguments)},{dup:30,ms:512}],512:[function(e,t,n){arguments[4][31][0].apply(n,arguments)},{dup:31}],513:[function(e,t,n){arguments[4][32][0].apply(n,arguments)},{dup:32}],514:[function(e,t,n){arguments[4][33][0].apply(n,arguments)},{"./_stream_readable":516,"./_stream_writable":518,_process:342,dup:33,inherits:249}],515:[function(e,t,n){arguments[4][34][0].apply(n,arguments)},{"./_stream_transform":517,dup:34,inherits:249}],516:[function(e,t,n){arguments[4][35][0].apply(n,arguments)},{"../errors":513,"./_stream_duplex":514,"./internal/streams/async_iterator":519,"./internal/streams/buffer_list":520,"./internal/streams/destroy":521,"./internal/streams/from":523,"./internal/streams/state":525,"./internal/streams/stream":526,_process:342,buffer:116,dup:35,events:196,inherits:249,"string_decoder/":481,util:73}],517:[function(e,t,n){arguments[4][36][0].apply(n,arguments)},{"../errors":513,"./_stream_duplex":514,dup:36,inherits:249}],518:[function(e,t,n){arguments[4][37][0].apply(n,arguments)},{"../errors":513,"./_stream_duplex":514,"./internal/streams/destroy":521,"./internal/streams/state":525,"./internal/streams/stream":526,_process:342,buffer:116,dup:37,inherits:249,"util-deprecate":500}],519:[function(e,t,n){arguments[4][38][0].apply(n,arguments)},{"./end-of-stream":522,_process:342,dup:38}],520:[function(e,t,n){arguments[4][39][0].apply(n,arguments)},{buffer:116,dup:39,util:73}],521:[function(e,t,n){arguments[4][40][0].apply(n,arguments)},{_process:342,dup:40}],522:[function(e,t,n){arguments[4][41][0].apply(n,arguments)},{"../../../errors":513,dup:41}],523:[function(e,t,n){arguments[4][42][0].apply(n,arguments)},{dup:42}],524:[function(e,t,n){arguments[4][43][0].apply(n,arguments)},{"../../../errors":513,"./end-of-stream":522,dup:43}],525:[function(e,t,n){arguments[4][44][0].apply(n,arguments)},{"../../../errors":513,dup:44}],526:[function(e,t,n){arguments[4][45][0].apply(n,arguments)},{dup:45,events:196}],527:[function(e,t,n){arguments[4][46][0].apply(n,arguments)},{"./lib/_stream_duplex.js":514,"./lib/_stream_passthrough.js":515,"./lib/_stream_readable.js":516,"./lib/_stream_transform.js":517,"./lib/_stream_writable.js":518,"./lib/internal/streams/end-of-stream.js":522,"./lib/internal/streams/pipeline.js":524,dup:46}],528:[function(e,t,n){t.exports={version:"1.3.10"}},{}],529:[function(e,t,n){t.exports=function e(t,n){if(t&&n)return e(t)(n);if("function"!=typeof t)throw new TypeError("need wrapper function");return Object.keys(t).forEach((function(e){i[e]=t[e]})),i;function i(){for(var e=new Array(arguments.length),n=0;n1080?(q.setProps({placement:"right"}),N.setProps({placement:"right"}),D.setProps({placement:"right"})):(q.setProps({placement:"top"}),N.setProps({placement:"top"}),D.setProps({placement:"top"}))}function W(e){Y();try{console.info("Attempting parse"),d=r(e),K(),d.xs&&(console.info("Magnet includes xs, attempting remote parse"),V(d.xs))}catch(t){console.warn(t),"magnet"==l?(console.info("Attempting remote parse"),V(e)):(H.error("Problem parsing input. Is this a .torrent file?"),console.error("Problem parsing input"))}}function V(e){r.remote(e,(function(e,t){if(e)return H.error("Problem remotely fetching that file or parsing result"),console.warn(e),void Y();l="remote-torrent-file",g.innerHTML='',v.setContent("Currently loaded information sourced from remotely fetched Torrent file"),d=t,K()}))}function K(){if(console.log(d),E.value=d.infoHash,y.value=d.name?d.name:"",d.created?(w.value=d.created.toISOString().slice(0,19),w.type="datetime-local"):w.type="text",x.value=d.createdBy?"by "+d.createdBy:"",k.value=d.comment?d.comment:"",I.innerHTML="",d.announce&&d.announce.length)for(let e=0;e',i.addEventListener("click",Q),t.appendChild(i),I.appendChild(t)}if(T.innerHTML="",d.urlList&&d.urlList.length)for(let e=0;e',i.addEventListener("click",Q),t.appendChild(i),T.appendChild(t)}if(B.innerHTML="",d.files&&d.files.length){if(R.style.display="none",d.files.length<100)for(let e of d.files){let t=G(a.lookup(e.name));B.appendChild($(t,e.name,e.length))}else{for(let e=0;e<100;e++){let t=G(a.lookup(d.files[e].name));B.appendChild($(t,d.files[e].name,d.files[e].length))}B.appendChild($("","...and another "+(d.files.length-100)+" more files",""))}B.appendChild($("folder-tree","",d.length)),D.setContent("Download Torrent file"),U.addEventListener("click",ie),U.disabled=!1}else z.torrents.length>0?(R.style.display="none",B.innerHTML=''):(R.style.display="block",B.innerHTML=''),D.setContent("Files metadata is required to generate a Torrent file. Try fetching files list from WebTorrent."),U.removeEventListener("click",ie),U.disabled=!0;L.setAttribute("data-clipboard-text",window.location.origin+"#"+r.toMagnetURI(d)),O.setAttribute("data-clipboard-text",r.toMagnetURI(d)),f.style.display="none",b.style.display="flex",window.location.hash=r.toMagnetURI(d),d.name?document.title="Torrent Parts | "+d.name:document.title="Torrent Parts | Inspect and edit what's in your Torrent file or Magnet link",v.enable(),gtag("event","view_item",{items:[{item_id:d.infoHash,item_name:d.name,item_category:l}]})}function $(e,t,n){let i=document.createElement("tr"),r=document.createElement("td");e&&(r.innerHTML=''),i.appendChild(r);let s=document.createElement("td");s.innerHTML=t,i.appendChild(s);let a=document.createElement("td");return a.innerHTML=o.format(n,{decimalPlaces:1,unitSeparator:" "}),i.appendChild(a),i}function G(e){if(!e)return"file";switch(!0){case e.includes("msword"):case e.includes("wordprocessingml"):case e.includes("opendocument.text"):case e.includes("abiword"):return"file-word";case e.includes("ms-excel"):case e.includes("spreadsheet"):return"file-powerpoint";case e.includes("powerpoint"):case e.includes("presentation"):return"file-powerpoint";case e.includes("7z-"):case e.includes("iso9660"):case e.includes("zip"):case e.includes("octet-stream"):return"file-archive";case e.includes("csv"):return"file-csv";case e.includes("pdf"):return"file-pdf";case e.includes("font"):return"file-contract";case e.includes("text"):case e.includes("subrip"):case e.includes("vtt"):return"file-alt";case e.includes("audio"):return"file-audio";case e.includes("image"):return"file-image";case e.includes("video"):return"file-video";default:return"file"}}function X(e){this.dataset.group?d[this.dataset.group][this.dataset.index]=this.value?this.value:"":d[this.id]=this.value?this.value:"",window.location.hash=r.toMagnetURI(d),te()}function Y(){document.getElementById("magnet").value="",document.getElementById("torrent").value="",f.style.display="flex",b.style.display="none",y.value="",w.value="",x.value="",k.value="",E.value="",I.innerHTML="",T.innerHTML="",z.torrents.forEach((e=>e.destroy())),R.style.display="block",B.innerHTML="",window.location.hash="",L.setAttribute("data-clipboard-text",""),O.setAttribute("data-clipboard-text",""),document.title="Torrent Parts | Inspect and edit what's in your Torrent file or Magnet link",v.disable(),gtag("event","reset")}async function Z(){S.className="disabled",S.innerHTML="Adding...";try{let e=await fetch("https://newtrackon.com/api/stable"),t=await e.text();d.announce=d.announce.concat(t.split("\n\n")),d.announce.push("http://bt1.archive.org:6969/announce"),d.announce.push("http://bt2.archive.org:6969/announce"),d.announce=d.announce.filter(((e,t)=>e&&d.announce.indexOf(e)===t)),H.success("Added known working trackers from newTrackon"),te()}catch(e){H.error("Problem fetching trackers from newTrackon"),console.warn(e)}S.className="",S.innerHTML="Add Known Working Trackers",K(),gtag("event","add_trackers")}function J(){d[this.dataset.type].unshift(""),K()}function Q(){d[this.parentElement.className].splice(this.parentElement.dataset.index,1),K()}function ee(e){d[e]=[],te(),K()}function te(){d.created=new Date,d.createdBy="Torrent Parts ",d.created?(w.value=d.created.toISOString().slice(0,19),w.type="datetime-local"):w.type="text",x.value=d.createdBy?"by "+d.createdBy:""}function ne(){console.info("Attempting fetching files from Webtorrent..."),R.style.display="none",d.announce.push("wss://tracker.webtorrent.io"),d.announce.push("wss://tracker.openwebtorrent.com"),d.announce.push("wss://tracker.btorrent.xyz"),d.announce.push("wss://tracker.fastcast.nz"),d.announce=d.announce.filter(((e,t)=>e&&d.announce.indexOf(e)===t)),z.add(r.toMagnetURI(d),(e=>{d.info=Object.assign({},e.info),d.files=e.files,d.infoBuffer=e.infoBuffer,d.length=e.length,d.lastPieceLength=e.lastPieceLength,te(),K(),H.success("Fetched file details from Webtorrent peers"),e.destroy()})),K(),gtag("event","attempt_webtorrent_fetch")}function ie(){let e=r.toTorrentFile(d);if(null!==e&&navigator.msSaveBlob)return navigator.msSaveBlob(new Blob([e],{type:"application/x-bittorrent"}),d.name+".torrent");let t=document.createElement("a");t.style.display="none";let n=window.URL.createObjectURL(new Blob([e],{type:"application/x-bittorrent"}));t.setAttribute("href",n),t.setAttribute("download",d.name+".torrent"),document.body.appendChild(t),t.click(),window.URL.revokeObjectURL(n),t.remove(),gtag("event","share",{method:"Torrent Download",content_id:d.name})}window.addEventListener("resize",F),F(),document.addEventListener("DOMContentLoaded",(function(){document.getElementById("magnet").addEventListener("keyup",(function(e){e.preventDefault(),"Enter"===e.key&&(l="magnet",g.innerHTML='',v.setContent("Currently loaded information sourced from Magnet URL"),W(magnet.value))})),document.getElementById("torrent").addEventListener("change",(function(e){e.preventDefault(),e.target.files[0].arrayBuffer().then((function(e){l="torrent-file",g.innerHTML='',v.setContent("Currently loaded information sourced from Torrent file"),W(s.from(e))}))})),document.addEventListener("dragover",(function(e){e.preventDefault()})),document.addEventListener("drop",(function(e){e.preventDefault(),e.dataTransfer.items[0].getAsFile().arrayBuffer().then((function(e){l="torrent-file",g.innerHTML='',v.setContent("Currently loaded information sourced from Torrent file"),W(s.from(e))}))})),p.addEventListener("click",(function(e){e.preventDefault(),H.success("Parsing Ubuntu 20.04 Magnet URL"),W("magnet:?xt=urn:btih:9fc20b9e98ea98b4a35e6223041a5ef94ea27809&dn=ubuntu-20.04-desktop-amd64.iso&tr=https%3A%2F%2Ftorrent.ubuntu.com%2Fannounce&tr=https%3A%2F%2Fipv6.torrent.ubuntu.com%2Fannounce")})),h.addEventListener("click",(async function(e){e.preventDefault(),H.success("Fetching and Parsing “The WIRED CD” Torrent File..."),V("https://webtorrent.io/torrents/wired-cd.torrent")})),m.addEventListener("click",(async function(e){e.preventDefault(),H.success("Parsing Jack Johnson Archive.org Torrent File");let t=await fetch("/ext/jj2008-06-14.mk4_archive.torrent"),n=await t.arrayBuffer();W(s.from(n))}));let e=new i("#copyURL");e.on("success",(function(e){H.success("Copied site URL to clipboard!"),console.info(e),gtag("event","share",{method:"Copy URL",content_id:e.text})})),e.on("failure",(function(e){H.error("Problem copying to clipboard"),console.warn(e)}));let t=new i("#copyMagnet");t.on("success",(function(e){H.success("Copied Magnet URL to clipboard!"),gtag("event","share",{method:"Copy Magnet",content_id:e.text})})),t.on("failure",(function(e){H.error("Problem copying to clipboard"),console.warn(e)})),y.addEventListener("input",X),y.addEventListener("change",X),y.addEventListener("reset",X),y.addEventListener("paste",X),_.addEventListener("click",Y),k.addEventListener("input",X),k.addEventListener("change",X),k.addEventListener("reset",X),k.addEventListener("paste",X),S.addEventListener("click",Z),M.addEventListener("click",J),A.addEventListener("click",(()=>ee("announce"))),j.addEventListener("click",J),C.addEventListener("click",(()=>ee("urlList"))),R.addEventListener("click",ne),u("[data-tippy-content]",{theme:"torrent-parts",animation:"shift-away-subtle"}),v.disable(),window.location.hash&&(l="shared-url",g.innerHTML='',v.setContent("Currently loaded information sourced from shared torrent.parts link"),W(window.location.hash.split("#")[1]))}))},{Buffer:2,bytes:122,clipboard:141,"mime-types":286,"parse-torrent":333,"tippy.js":484,webtorrent:503}]},{},[531]); \ No newline at end of file +const n=e("events"),r=e("path"),s=e("simple-concat"),a=e("create-torrent"),o=e("debug"),c=e("bittorrent-dht/client"),l=e("load-ip-set"),u=e("run-parallel"),p=e("parse-torrent"),d=e("simple-peer"),f=e("queue-microtask"),h=e("randombytes"),m=e("simple-sha1"),b=e("speedometer"),{ThrottleGroup:v}=e("speed-limiter"),g=e("./lib/conn-pool.js"),y=e("./lib/torrent.js"),{version:_}=e("./package.json"),x=o("webtorrent"),w=_.replace(/\d*./g,(e=>("0"+e%100).slice(-2))).slice(0,4),k=`-WW${w}-`;class E extends n{constructor(t={}){super(),"string"==typeof t.peerId?this.peerId=t.peerId:i.isBuffer(t.peerId)?this.peerId=t.peerId.toString("hex"):this.peerId=i.from(k+h(9).toString("base64")).toString("hex"),this.peerIdBuffer=i.from(this.peerId,"hex"),"string"==typeof t.nodeId?this.nodeId=t.nodeId:i.isBuffer(t.nodeId)?this.nodeId=t.nodeId.toString("hex"):this.nodeId=h(20).toString("hex"),this.nodeIdBuffer=i.from(this.nodeId,"hex"),this._debugId=this.peerId.toString("hex").substring(0,7),this.destroyed=!1,this.listening=!1,this.torrentPort=t.torrentPort||0,this.dhtPort=t.dhtPort||0,this.tracker=void 0!==t.tracker?t.tracker:{},this.lsd=!1!==t.lsd,this.torrents=[],this.maxConns=Number(t.maxConns)||55,this.utp=E.UTP_SUPPORT&&!1!==t.utp,this._downloadLimit=Math.max("number"==typeof t.downloadLimit?t.downloadLimit:-1,-1),this._uploadLimit=Math.max("number"==typeof t.uploadLimit?t.uploadLimit:-1,-1),this.serviceWorker=null,this.workerKeepAliveInterval=null,this.workerPortCount=0,!0===t.secure&&e("./lib/peer").enableSecure(),this._debug("new webtorrent (peerId %s, nodeId %s, port %s)",this.peerId,this.nodeId,this.torrentPort),this.throttleGroups={down:new v({rate:Math.max(this._downloadLimit,0),enabled:this._downloadLimit>=0}),up:new v({rate:Math.max(this._uploadLimit,0),enabled:this._uploadLimit>=0})},this.tracker&&("object"!=typeof this.tracker&&(this.tracker={}),globalThis.WRTC&&!this.tracker.wrtc&&(this.tracker.wrtc=globalThis.WRTC)),"function"==typeof g?this._connPool=new g(this):f((()=>{this._onListening()})),this._downloadSpeed=b(),this._uploadSpeed=b(),!1!==t.dht&&"function"==typeof c?(this.dht=new c(Object.assign({},{nodeId:this.nodeId},t.dht)),this.dht.once("error",(e=>{this._destroy(e)})),this.dht.once("listening",(()=>{const e=this.dht.address();e&&(this.dhtPort=e.port)})),this.dht.setMaxListeners(0),this.dht.listen(this.dhtPort)):this.dht=!1,this.enableWebSeeds=!1!==t.webSeeds;const n=()=>{this.destroyed||(this.ready=!0,this.emit("ready"))};"function"==typeof l&&null!=t.blocklist?l(t.blocklist,{headers:{"user-agent":`WebTorrent/${_} (https://webtorrent.io)`}},((e,t)=>{if(e)return console.error(`Failed to load blocklist: ${e.message}`);this.blocked=t,n()})):f(n)}loadWorker(e,t=(()=>{})){if(!(e instanceof ServiceWorker))throw new Error("Invalid worker registration");if("activated"!==e.state)throw new Error("Worker isn't activated");this.serviceWorker=e,navigator.serviceWorker.addEventListener("message",(e=>{const{data:t}=e;if(!t.type||"webtorrent"===!t.type||!t.url)return null;let[i,...n]=t.url.slice(t.url.indexOf(t.scope+"webtorrent/")+11+t.scope.length).split("/");if(n=decodeURI(n.join("/")),!i||!n)return null;const[r]=e.ports,s=this.get(i)&&this.get(i).files.find((e=>e.path===n));if(!s)return null;const[a,o,c]=s._serve(t),l=o&&o[Symbol.asyncIterator](),u=()=>{r.onmessage=null,o&&o.destroy(),c&&c.destroy(),this.workerPortCount--,this.workerPortCount||(clearInterval(this.workerKeepAliveInterval),this.workerKeepAliveInterval=null)};r.onmessage=async e=>{if(e.data){let e;try{e=(await l.next()).value}catch(e){}r.postMessage(e),e||u(),this.workerKeepAliveInterval||(this.workerKeepAliveInterval=setInterval((()=>fetch(`${this.serviceWorker.scriptURL.substr(0,this.serviceWorker.scriptURL.lastIndexOf("/")+1).slice(window.location.origin.length)}webtorrent/keepalive/`)),2e4))}else u()},this.workerPortCount++,r.postMessage(a)})),t(this.serviceWorker)}get downloadSpeed(){return this._downloadSpeed()}get uploadSpeed(){return this._uploadSpeed()}get progress(){const e=this.torrents.filter((e=>1!==e.progress));return e.reduce(((e,t)=>e+t.downloaded),0)/(e.reduce(((e,t)=>e+(t.length||0)),0)||1)}get ratio(){return this.torrents.reduce(((e,t)=>e+t.uploaded),0)/(this.torrents.reduce(((e,t)=>e+t.received),0)||1)}get(e){if(e instanceof y){if(this.torrents.includes(e))return e}else{let t;try{t=p(e)}catch(e){}if(!t)return null;if(!t.infoHash)throw new Error("Invalid torrent identifier");for(const e of this.torrents)if(e.infoHash===t.infoHash)return e}return null}add(e,t={},i=(()=>{})){if(this.destroyed)throw new Error("client is destroyed");"function"==typeof t&&([t,i]=[{},t]);const n=()=>{if(!this.destroyed)for(const e of this.torrents)if(e.infoHash===s.infoHash&&e!==s)return void s._destroy(new Error(`Cannot add duplicate torrent ${s.infoHash}`))},r=()=>{this.destroyed||(i(s),this.emit("torrent",s))};this._debug("add"),t=t?Object.assign({},t):{};const s=new y(e,this,t);return this.torrents.push(s),s.once("_infoHash",n),s.once("ready",r),s.once("close",(function e(){s.removeListener("_infoHash",n),s.removeListener("ready",r),s.removeListener("close",e)})),s}seed(e,t,i){if(this.destroyed)throw new Error("client is destroyed");"function"==typeof t&&([t,i]=[{},t]),this._debug("seed"),(t=t?Object.assign({},t):{}).skipVerify=!0;const n="string"==typeof e;n&&(t.path=r.dirname(e)),t.createdBy||(t.createdBy=`WebTorrent/${w}`);const o=e=>{this._debug("on seed"),"function"==typeof i&&i(e),e.emit("seed"),this.emit("seed",e)},c=this.add(null,t,(e=>{const i=[i=>{if(n||t.preloadedStore)return i();e.load(l,i)}];this.dht&&i.push((t=>{e.once("dhtAnnounce",t)})),u(i,(t=>{if(!this.destroyed)return t?e._destroy(t):void o(e)}))}));let l;var p;return p=e,"undefined"!=typeof FileList&&p instanceof FileList?e=Array.from(e):Array.isArray(e)||(e=[e]),u(e.map((e=>i=>{!t.preloadedStore&&function(e){return"object"==typeof e&&null!=e&&"function"==typeof e.pipe}(e)?s(e,((t,n)=>{if(t)return i(t);n.name=e.name,i(null,n)})):i(null,e)})),((e,i)=>{if(!this.destroyed)return e?c._destroy(e):void a.parseInput(i,t,((e,n)=>{if(!this.destroyed){if(e)return c._destroy(e);l=n.map((e=>e.getStream)),a(i,t,((e,t)=>{if(this.destroyed)return;if(e)return c._destroy(e);const i=this.get(t);i?c._destroy(new Error(`Cannot add duplicate torrent ${i.infoHash}`)):c._onTorrentId(t)}))}}))})),c}remove(e,t,i){if("function"==typeof t)return this.remove(e,null,t);this._debug("remove");if(!this.get(e))throw new Error(`No torrent with id ${e}`);this._remove(e,t,i)}_remove(e,t,i){if("function"==typeof t)return this._remove(e,null,t);const n=this.get(e);n&&(this.torrents.splice(this.torrents.indexOf(n),1),n.destroy(t,i),this.dht&&this.dht._tables.remove(n.infoHash))}address(){return this.listening?this._connPool?this._connPool.tcpServer.address():{address:"0.0.0.0",family:"IPv4",port:0}:null}throttleDownload(e){return e=Number(e),!(isNaN(e)||!isFinite(e)||e<-1)&&(this._downloadLimit=e,this._downloadLimit<0?this.throttleGroups.down.setEnabled(!1):(this.throttleGroups.down.setEnabled(!0),void this.throttleGroups.down.setRate(this._downloadLimit)))}throttleUpload(e){return e=Number(e),!(isNaN(e)||!isFinite(e)||e<-1)&&(this._uploadLimit=e,this._uploadLimit<0?this.throttleGroups.up.setEnabled(!1):(this.throttleGroups.up.setEnabled(!0),void this.throttleGroups.up.setRate(this._uploadLimit)))}destroy(e){if(this.destroyed)throw new Error("client already destroyed");this._destroy(null,e)}_destroy(e,t){this._debug("client destroy"),this.destroyed=!0;const i=this.torrents.map((e=>t=>{e.destroy(t)}));this._connPool&&i.push((e=>{this._connPool.destroy(e)})),this.dht&&i.push((e=>{this.dht.destroy(e)})),u(i,t),e&&this.emit("error",e),this.torrents=[],this._connPool=null,this.dht=null,this.throttleGroups.down.destroy(),this.throttleGroups.up.destroy()}_onListening(){if(this._debug("listening"),this.listening=!0,this._connPool){const e=this._connPool.tcpServer.address();e&&(this.torrentPort=e.port)}this.emit("listening")}_debug(){const e=[].slice.call(arguments);e[0]=`[${this._debugId}] ${e[0]}`,x(...e)}_getByHash(e){for(const t of this.torrents)if(t.infoHashHash||(t.infoHashHash=m.sync(i.from("72657132"+t.infoHash,"hex"))),e===t.infoHashHash)return t;return null}}E.WEBRTC_SUPPORT=d.WEBRTC_SUPPORT,E.UTP_SUPPORT=g.UTP_SUPPORT,E.VERSION=_,t.exports=E}).call(this)}).call(this,e("buffer").Buffer)},{"./lib/conn-pool.js":67,"./lib/peer":491,"./lib/torrent.js":493,"./package.json":495,"bittorrent-dht/client":67,buffer:110,"create-torrent":144,debug:161,events:193,"load-ip-set":67,"parse-torrent":332,path:333,"queue-microtask":354,randombytes:357,"run-parallel":381,"simple-concat":393,"simple-peer":395,"simple-sha1":411,"speed-limiter":429,speedometer:433}],489:[function(e,t,i){const n=e("stream"),r=e("debug"),s=e("end-of-stream"),a=r("webtorrent:file-stream");class o extends n.Readable{constructor(e,t){super(t),this._torrent=e._torrent;const i=t&&t.start||0,n=t&&t.end&&t.end{this._notify()})),s(this,(e=>{this.destroy(e)}))}_read(){this._reading||(this._reading=!0,this._notify())}_notify(){if(!this._reading||0===this._missing)return;if(!this._torrent.bitfield.get(this._piece))return this._torrent.critical(this._piece,this._piece+this._criticalLength);if(this._notifying)return;if(this._notifying=!0,this._torrent.destroyed)return this.destroy(new Error("Torrent removed"));const e=this._piece,t={};e===this._torrent.pieces.length-1&&(t.length=this._torrent.lastPieceLength),this._torrent.store.get(e,t,((t,i)=>{if(this._notifying=!1,!this.destroyed){if(a("read %s (length %s) (err %s)",e,i&&i.length,t&&t.message),t)return this.destroy(t);this._offset&&(i=i.slice(this._offset),this._offset=0),this._missing{const s=r===e.length-1?n:i;return t.get(r)?s:s-e[r].missing};let o=0;for(let t=r;t<=s;t+=1){const c=a(t);if(o+=c,t===r){const e=this.offset%i;o-=Math.min(e,c)}if(t===s){const t=(s===e.length-1?n:i)-(this.offset+this.length)%i;o-=Math.min(t,c)}}return o}get progress(){return this.length?this.downloaded/this.length:0}select(e){0!==this.length&&this._torrent.select(this._startPiece,this._endPiece,e)}deselect(){0!==this.length&&this._torrent.deselect(this._startPiece,this._endPiece,!1)}createReadStream(e){if(0===this.length){const e=new r;return u((()=>{e.end()})),e}const t=new h(this,e);return this._fileStreams.add(t),t.once("close",(()=>{this._fileStreams.delete(t)})),t}getBuffer(e){l(this.createReadStream(),this.length,e)}getBlob(e){if("undefined"==typeof window)throw new Error("browser-only method");o(this.createReadStream(),this._getMimeType()).then((t=>e(null,t)),(t=>e(t)))}getBlobURL(e){if("undefined"==typeof window)throw new Error("browser-only method");c(this.createReadStream(),this._getMimeType()).then((t=>e(null,t)),(t=>e(t)))}appendTo(e,t,i){if("undefined"==typeof window)throw new Error("browser-only method");a.append(this,e,t,i)}renderTo(e,t,i){if("undefined"==typeof window)throw new Error("browser-only method");a.render(this,e,t,i)}_serve(e){const t={status:200,headers:{"Accept-Ranges":"bytes","Content-Type":d.getType(this.name),"Cache-Control":"no-cache, no-store, must-revalidate, max-age=0",Expires:"0"},body:"HEAD"===e.method?"":"STREAM"};"document"===e.destination&&(t.headers["Content-Type"]="application/octet-stream",t.headers["Content-Disposition"]="attachment",t.body="DOWNLOAD");let i=p(this.length,e.headers.range||"");i.constructor===Array?(t.status=206,i=i[0],t.headers["Content-Range"]=`bytes ${i.start}-${i.end}/${this.length}`,t.headers["Content-Length"]=""+(i.end-i.start+1)):t.headers["Content-Length"]=this.length;const n="GET"===e.method&&this.createReadStream(i);let r=null;return n&&this.emit("stream",{stream:n,req:e,file:this},(e=>{r=e,f(e,(()=>{e&&e.destroy(),n.destroy()}))})),[t,r||n,r&&n]}getStreamURL(e=(()=>{})){if("undefined"==typeof window)throw new Error("browser-only method");if(!this._serviceWorker)throw new Error("No worker registered");if("activated"!==this._serviceWorker.state)throw new Error("Worker isn't activated");e(null,`${this._serviceWorker.scriptURL.substr(0,this._serviceWorker.scriptURL.lastIndexOf("/")+1).slice(window.location.origin.length)}webtorrent/${this._torrent.infoHash}/${encodeURI(this.path)}`)}streamTo(e,t=(()=>{})){if("undefined"==typeof window)throw new Error("browser-only method");if(!this._serviceWorker)throw new Error("No worker registered");if("activated"!==this._serviceWorker.state)throw new Error("Worker isn't activated");const i=this._serviceWorker.scriptURL.substr(0,this._serviceWorker.scriptURL.lastIndexOf("/")+1).slice(window.location.origin.length);e.src=`${i}webtorrent/${this._torrent.infoHash}/${encodeURI(this.path)}`,t(null,e)}_getMimeType(){return a.mime[s.extname(this.name).toLowerCase()]}_destroy(){this._destroyed=!0,this._torrent=null;for(const e of this._fileStreams)e.destroy();this._fileStreams.clear()}}},{"./file-stream.js":489,"end-of-stream":191,events:193,mime:282,path:333,"queue-microtask":354,"range-parser":359,"render-media":377,stream:434,"stream-to-blob":469,"stream-to-blob-url":468,"stream-with-known-length-to-buffer":470}],491:[function(e,t,i){const n=e("events"),{Transform:r}=e("stream"),s=e("unordered-array-remove"),a=e("debug"),o=e("bittorrent-protocol"),c=a("webtorrent:peer");let l=!1;i.enableSecure=()=>{l=!0},i.createWebRTCPeer=(e,t,i)=>{const n=new d(e.id,"webrtc");if(n.conn=e,n.swarm=t,n.throttleGroups=i,n.conn.connected)n.onConnect();else{const e=()=>{n.conn.removeListener("connect",t),n.conn.removeListener("error",i)},t=()=>{e(),n.onConnect()},i=t=>{e(),n.destroy(t)};n.conn.once("connect",t),n.conn.once("error",i),n.startConnectTimeout()}return n},i.createTCPIncomingPeer=(e,t)=>u(e,"tcpIncoming",t),i.createUTPIncomingPeer=(e,t)=>u(e,"utpIncoming",t),i.createTCPOutgoingPeer=(e,t,i)=>p(e,t,"tcpOutgoing",i),i.createUTPOutgoingPeer=(e,t,i)=>p(e,t,"utpOutgoing",i);const u=(e,t,i)=>{const n=`${e.remoteAddress}:${e.remotePort}`,r=new d(n,t);return r.conn=e,r.addr=n,r.throttleGroups=i,r.onConnect(),r},p=(e,t,i,n)=>{const r=new d(e,i);return r.addr=e,r.swarm=t,r.throttleGroups=n,r};i.createWebSeedPeer=(e,t,i,n)=>{const r=new d(t,"webSeed");return r.swarm=i,r.conn=e,r.throttleGroups=n,r.onConnect(),r};class d extends n{constructor(e,t){super(),this.id=e,this.type=t,c("new %s Peer %s",t,e),this.addr=null,this.conn=null,this.swarm=null,this.wire=null,this.connected=!1,this.destroyed=!1,this.timeout=null,this.retries=0,this.sentPe1=!1,this.sentPe2=!1,this.sentPe3=!1,this.sentPe4=!1,this.sentHandshake=!1}onConnect(){if(this.destroyed)return;this.connected=!0,c("Peer %s connected",this.id),clearTimeout(this.connectTimeout);const e=this.conn;e.once("end",(()=>{this.destroy()})),e.once("close",(()=>{this.destroy()})),e.once("finish",(()=>{this.destroy()})),e.once("error",(e=>{this.destroy(e)}));const t=this.wire=new o(this.type,this.retries,l);t.once("end",(()=>{this.destroy()})),t.once("close",(()=>{this.destroy()})),t.once("finish",(()=>{this.destroy()})),t.once("error",(e=>{this.destroy(e)})),t.once("pe1",(()=>{this.onPe1()})),t.once("pe2",(()=>{this.onPe2()})),t.once("pe3",(()=>{this.onPe3()})),t.once("pe4",(()=>{this.onPe4()})),t.once("handshake",((e,t)=>{this.onHandshake(e,t)})),this.startHandshakeTimeout(),this.setThrottlePipes(),this.swarm&&("tcpOutgoing"===this.type?l&&0===this.retries&&!this.sentPe1?this.sendPe1():this.sentHandshake||this.handshake():"tcpIncoming"===this.type||this.sentHandshake||this.handshake())}sendPe1(){this.wire.sendPe1(),this.sentPe1=!0}onPe1(){this.sendPe2()}sendPe2(){this.wire.sendPe2(),this.sentPe2=!0}onPe2(){this.sendPe3()}sendPe3(){this.wire.sendPe3(this.swarm.infoHash),this.sentPe3=!0}onPe3(e){this.swarm&&(this.swarm.infoHashHash!==e&&this.destroy(new Error("unexpected crypto handshake info hash for this swarm")),this.sendPe4())}sendPe4(){this.wire.sendPe4(this.swarm.infoHash),this.sentPe4=!0}onPe4(){this.sentHandshake||this.handshake()}clearPipes(){this.conn.unpipe(),this.wire.unpipe()}setThrottlePipes(){const e=this;this.conn.pipe(this.throttleGroups.down.throttle()).pipe(new r({transform(t,i,n){e.emit("download",t.length),e.destroyed||n(null,t)}})).pipe(this.wire).pipe(this.throttleGroups.up.throttle()).pipe(new r({transform(t,i,n){e.emit("upload",t.length),e.destroyed||n(null,t)}})).pipe(this.conn)}onHandshake(e,t){if(!this.swarm)return;if(this.destroyed)return;if(this.swarm.destroyed)return this.destroy(new Error("swarm already destroyed"));if(e!==this.swarm.infoHash)return this.destroy(new Error("unexpected handshake info hash for this swarm"));if(t===this.swarm.peerId)return this.destroy(new Error("refusing to connect to ourselves"));c("Peer %s got handshake %s",this.id,e),clearTimeout(this.handshakeTimeout),this.retries=0;let i=this.addr;!i&&this.conn.remoteAddress&&this.conn.remotePort&&(i=`${this.conn.remoteAddress}:${this.conn.remotePort}`),this.swarm._onWire(this.wire,i),this.swarm&&!this.swarm.destroyed&&(this.sentHandshake||this.handshake())}handshake(){const e={dht:!this.swarm.private&&!!this.swarm.client.dht};this.wire.handshake(this.swarm.infoHash,this.swarm.client.peerId,e),this.sentHandshake=!0}startConnectTimeout(){clearTimeout(this.connectTimeout);const e={webrtc:25e3,tcpOutgoing:5e3,utpOutgoing:5e3};this.connectTimeout=setTimeout((()=>{this.destroy(new Error("connect timeout"))}),e[this.type]),this.connectTimeout.unref&&this.connectTimeout.unref()}startHandshakeTimeout(){clearTimeout(this.handshakeTimeout),this.handshakeTimeout=setTimeout((()=>{this.destroy(new Error("handshake timeout"))}),25e3),this.handshakeTimeout.unref&&this.handshakeTimeout.unref()}destroy(e){if(this.destroyed)return;this.destroyed=!0,this.connected=!1,c("destroy %s %s (error: %s)",this.type,this.id,e&&(e.message||e)),clearTimeout(this.connectTimeout),clearTimeout(this.handshakeTimeout);const t=this.swarm,i=this.conn,n=this.wire;this.swarm=null,this.conn=null,this.wire=null,t&&n&&s(t.wires,t.wires.indexOf(n)),i&&(i.on("error",(()=>{})),i.destroy()),n&&n.destroy(),t&&t.removePeer(this.id)}}},{"bittorrent-protocol":28,debug:161,events:193,stream:434,"unordered-array-remove":481}],492:[function(e,t,i){t.exports=class{constructor(e){this._torrent=e,this._numPieces=e.pieces.length,this._pieces=new Array(this._numPieces),this._onWire=e=>{this.recalculate(),this._initWire(e)},this._onWireHave=e=>{this._pieces[e]+=1},this._onWireBitfield=()=>{this.recalculate()},this._torrent.wires.forEach((e=>{this._initWire(e)})),this._torrent.on("wire",this._onWire),this.recalculate()}getRarestPiece(e){let t=[],i=1/0;for(let n=0;n{this._cleanupWireEvents(e)})),this._torrent=null,this._pieces=null,this._onWire=null,this._onWireHave=null,this._onWireBitfield=null}_initWire(e){e._onClose=()=>{this._cleanupWireEvents(e);for(let t=0;t{this.destroyed||this._onParsedTorrent(t)}))):E.remote(e,((e,t)=>{if(!this.destroyed)return e?this._destroy(e):void this._onParsedTorrent(t)}))}_onParsedTorrent(e){if(!this.destroyed){if(this._processParsedTorrent(e),!this.infoHash)return this._destroy(new Error("Malformed torrent data: No info hash"));this._rechokeIntervalId=setInterval((()=>{this._rechoke()}),1e4),this._rechokeIntervalId.unref&&this._rechokeIntervalId.unref(),this.emit("_infoHash",this.infoHash),this.destroyed||(this.emit("infoHash",this.infoHash),this.destroyed||(this.client.listening?this._onListening():this.client.once("listening",(()=>{this._onListening()}))))}}_processParsedTorrent(e){this._debugId=e.infoHash.toString("hex").substring(0,7),void 0!==this.private&&(e.private=this.private),this.announce&&(e.announce=e.announce.concat(this.announce)),this.client.tracker&&n.WEBTORRENT_ANNOUNCE&&!e.private&&(e.announce=e.announce.concat(n.WEBTORRENT_ANNOUNCE)),this.urlList&&(e.urlList=e.urlList.concat(this.urlList)),e.announce=Array.from(new Set(e.announce)),e.urlList=Array.from(new Set(e.urlList)),Object.assign(this,e),this.magnetURI=E.toMagnetURI(e),this.torrentFile=E.toTorrentFile(e)}_onListening(){this.destroyed||(this.info?this._onMetadata(this):(this.xs&&this._getMetadataFromServer(),this._startDiscovery()))}_startDiscovery(){if(this.discovery||this.destroyed)return;let e=this.client.tracker;e&&(e=Object.assign({},this.client.tracker,{getAnnounceOpts:()=>{if(this.destroyed)return;const e={uploaded:this.uploaded,downloaded:this.downloaded,left:Math.max(this.length-this.downloaded,0)};return this.client.tracker.getAnnounceOpts&&Object.assign(e,this.client.tracker.getAnnounceOpts()),this._getAnnounceOpts&&Object.assign(e,this._getAnnounceOpts()),e}})),this.peerAddresses&&this.peerAddresses.forEach((e=>this.addPeer(e))),this.discovery=new m({infoHash:this.infoHash,announce:this.announce,peerId:this.client.peerId,dht:!this.private&&this.client.dht,tracker:e,port:this.client.torrentPort,userAgent:W,lsd:this.client.lsd}),this.discovery.on("error",(e=>{this._destroy(e)})),this.discovery.on("peer",((e,t)=>{this._debug("peer %s discovered via %s",e,t),"string"==typeof e&&this.done||this.addPeer(e)})),this.discovery.on("trackerAnnounce",(()=>{this.emit("trackerAnnounce"),0===this.numPeers&&this.emit("noPeers","tracker")})),this.discovery.on("dhtAnnounce",(()=>{this.emit("dhtAnnounce"),0===this.numPeers&&this.emit("noPeers","dht")})),this.discovery.on("warning",(e=>{this.emit("warning",e)}))}_getMetadataFromServer(){const e=this,t=(Array.isArray(this.xs)?this.xs:[this.xs]).map((t=>i=>{!function(t,i){if(0!==t.indexOf("http://")&&0!==t.indexOf("https://"))return e.emit("warning",new Error(`skipping non-http xs param: ${t}`)),i(null);const n={url:t,method:"GET",headers:{"user-agent":W}};let r;try{r=v.concat(n,s)}catch(n){return e.emit("warning",new Error(`skipping invalid url xs param: ${t}`)),i(null)}function s(n,r,s){if(e.destroyed)return i(null);if(e.metadata)return i(null);if(n)return e.emit("warning",new Error(`http error from xs param: ${t}`)),i(null);if(200!==r.statusCode)return e.emit("warning",new Error(`non-200 status code ${r.statusCode} from xs param: ${t}`)),i(null);let a;try{a=E(s)}catch(n){}return a?a.infoHash!==e.infoHash?(e.emit("warning",new Error(`got torrent file with incorrect info hash from xs param: ${t}`)),i(null)):(e._onMetadata(a),void i(null)):(e.emit("warning",new Error(`got invalid torrent file from xs param: ${t}`)),i(null))}e._xsRequests.push(r)}(t,i)}));w(t)}_onMetadata(e){if(this.metadata||this.destroyed)return;let t;if(this._debug("got metadata"),this._xsRequests.forEach((e=>{e.abort()})),this._xsRequests=[],e&&e.infoHash)t=e;else try{t=E(e)}catch(e){return this._destroy(e)}this._processParsedTorrent(t),this.metadata=this.torrentFile,this.client.enableWebSeeds&&this.urlList.forEach((e=>{this.addWebSeed(e)})),this._rarityMap=new O(this),this.files=this.files.map((e=>new R(this,e)));let i=this._preloadedStore;if(i||(i=new this._store(this.pieceLength,{...this.storeOpts,torrent:this,path:this.path,files:this.files,length:this.length,name:this.name+" - "+this.infoHash.slice(0,8),addUID:this.addUID})),this._storeCacheSlots>0&&!(i instanceof _)&&(i=new p(i,{max:this._storeCacheSlots})),this.store=new g(i),this.so?this.files.forEach(((e,t)=>{this.so.includes(t)?this.files[t].select():this.files[t].deselect()})):0!==this.pieces.length&&this.select(0,this.pieces.length-1,!1),this._hashes=this.pieces,this.pieces=this.pieces.map(((e,t)=>{const i=t===this.pieces.length-1?this.lastPieceLength:this.pieceLength;return new S(i)})),this._reservations=this.pieces.map((()=>[])),this.bitfield=new u(this.pieces.length),this.wires.forEach((e=>{e.ut_metadata&&e.ut_metadata.setMetadata(this.metadata),this._onWireWithMetadata(e)})),this.emit("metadata"),!this.destroyed)if(this.skipVerify)this._markAllVerified(),this._onStore();else{const e=e=>{if(e)return this._destroy(e);this._debug("done verifying"),this._onStore()};this._debug("verifying existing torrent data"),this._fileModtimes&&this._store===b?this.getFileModtimes(((t,i)=>{if(t)return this._destroy(t);this.files.map(((e,t)=>i[t]===this._fileModtimes[t])).every((e=>e))?(this._markAllVerified(),this._onStore()):this._verifyPieces(e)})):this._verifyPieces(e)}}getFileModtimes(e){const t=[];k(this.files.map(((e,i)=>n=>{const r=this.addUID?c.join(this.name+" - "+this.infoHash.slice(0,8)):c.join(this.path,e.path);s.stat(r,((e,r)=>{if(e&&"ENOENT"!==e.code)return n(e);t[i]=r&&r.mtime.getTime(),n(null)}))})),H,(i=>{this._debug("done getting file modtimes"),e(i,t)}))}_verifyPieces(e){k(this.pieces.map(((e,t)=>e=>{if(this.destroyed)return e(new Error("torrent is destroyed"));const i={};t===this.pieces.length-1&&(i.length=this.lastPieceLength),this.store.get(t,i,((i,n)=>this.destroyed?e(new Error("torrent is destroyed")):i?A((()=>e(null))):void I(n,(i=>{if(this.destroyed)return e(new Error("torrent is destroyed"));i===this._hashes[t]?(this._debug("piece verified %s",t),this._markVerified(t)):this._debug("piece invalid %s",t),e(null)}))))})),H,e)}rescanFiles(e){if(this.destroyed)throw new Error("torrent is destroyed");e||(e=$),this._verifyPieces((t=>{if(t)return this._destroy(t),e(t);this._checkDone(),e(null)}))}_markAllVerified(){for(let e=0;e{e.abort()})),this._rarityMap&&this._rarityMap.destroy();for(const e in this._peers)this.removePeer(e);this.files.forEach((e=>{e instanceof R&&e._destroy()}));const n=this._servers.map((e=>t=>{e.destroy(t)}));if(this.discovery&&n.push((e=>{this.discovery.destroy(e)})),this.store){let e=this._destroyStoreOnDestroy;t&&void 0!==t.destroyStore&&(e=t.destroyStore),n.push((t=>{e?this.store.destroy(t):this.store.close(t)}))}w(n,i),e&&(0===this.listenerCount("error")?this.client.emit("error",e):this.emit("error",e)),this.emit("close"),this.client=null,this.files=[],this.discovery=null,this.store=null,this._rarityMap=null,this._peers=null,this._servers=null,this._xsRequests=null}addPeer(e){if(this.destroyed)throw new Error("torrent is destroyed");if(!this.infoHash)throw new Error("addPeer() must not be called before the `infoHash` event");let t;if(this.client.blocked){if("string"==typeof e){let i;try{i=l(e)}catch(t){return this._debug("ignoring peer: invalid %s",e),this.emit("invalidPeer",e),!1}t=i[0]}else"string"==typeof e.remoteAddress&&(t=e.remoteAddress);if(t&&this.client.blocked.contains(t))return this._debug("ignoring peer: blocked %s",e),"string"!=typeof e&&e.destroy(),this.emit("blockedPeer",e),!1}const i=this.client.utp&&this._isIPv4(t)?"utp":"tcp",n=!!this._addPeer(e,i);return n?this.emit("peer",e):this.emit("invalidPeer",e),n}_addPeer(e,t){if(this.destroyed)return"string"!=typeof e&&e.destroy(),null;if("string"==typeof e&&!this._validAddr(e))return this._debug("ignoring peer: invalid %s",e),null;const i=e&&e.id||e;if(this._peers[i])return this._debug("ignoring peer: duplicate (%s)",i),"string"!=typeof e&&e.destroy(),null;if(this.paused)return this._debug("ignoring peer: torrent is paused"),"string"!=typeof e&&e.destroy(),null;let n;return this._debug("add peer %s",i),n="string"==typeof e?"utp"===t?L.createUTPOutgoingPeer(e,this,this.client.throttleGroups):L.createTCPOutgoingPeer(e,this,this.client.throttleGroups):L.createWebRTCPeer(e,this,this.client.throttleGroups),this._registerPeer(n),"string"==typeof e&&(this._queue.push(n),this._drain()),n}addWebSeed(e){if(this.destroyed)throw new Error("torrent is destroyed");let t,i;if("string"==typeof e){if(t=e,!/^https?:\/\/.+/.test(t))return this.emit("warning",new Error(`ignoring invalid web seed: ${t}`)),void this.emit("invalidPeer",t);if(this._peers[t])return this.emit("warning",new Error(`ignoring duplicate web seed: ${t}`)),void this.emit("invalidPeer",t);i=new q(t,this)}else{if(!e||"string"!=typeof e.connId)return void this.emit("warning",new Error("addWebSeed must be passed a string or connection object with id property"));if(i=e,t=i.connId,this._peers[t])return this.emit("warning",new Error(`ignoring duplicate web seed: ${t}`)),void this.emit("invalidPeer",t)}this._debug("add web seed %s",t);const n=L.createWebSeedPeer(i,t,this,this.client.throttleGroups);this._registerPeer(n),this.emit("peer",t)}_addIncomingPeer(e){return this.destroyed?e.destroy(new Error("torrent is destroyed")):this.paused?e.destroy(new Error("torrent is paused")):(this._debug("add incoming peer %s",e.id),void this._registerPeer(e))}_registerPeer(e){e.on("download",(e=>{this.destroyed||(this.received+=e,this._downloadSpeed(e),this.client._downloadSpeed(e),this.emit("download",e),this.destroyed||this.client.emit("download",e))})),e.on("upload",(e=>{this.destroyed||(this.uploaded+=e,this._uploadSpeed(e),this.client._uploadSpeed(e),this.emit("upload",e),this.destroyed||this.client.emit("upload",e))})),this._peers[e.id]=e,this._peersLength+=1}removePeer(e){const t=e&&e.id||e;(e=this._peers[t])&&(this._debug("removePeer %s",t),delete this._peers[t],this._peersLength-=1,e.destroy(),this._drain())}select(e,t,i,n){if(this.destroyed)throw new Error("torrent is destroyed");if(e<0||tt.priority-e.priority)),this._updateSelections()}deselect(e,t,i){if(this.destroyed)throw new Error("torrent is destroyed");i=Number(i)||0,this._debug("deselect %s-%s (priority %s)",e,t,i);for(let n=0;n{if(!this.destroyed&&!this.client.dht.destroyed){if(!e.remoteAddress)return this._debug("ignoring PORT from peer with no address");if(0===i||i>65536)return this._debug("ignoring invalid PORT from peer");this._debug("port: %s (from %s)",i,t),this.client.dht.addNode({host:e.remoteAddress,port:i})}})),e.on("timeout",(()=>{this._debug("wire timeout (%s)",t),e.destroy()})),"webSeed"!==e.type&&e.setTimeout(3e4,!0),e.setKeepAlive(!0),e.use(C(this.metadata)),e.ut_metadata.on("warning",(e=>{this._debug("ut_metadata warning: %s",e.message)})),this.metadata||(e.ut_metadata.on("metadata",(e=>{this._debug("got metadata via ut_metadata"),this._onMetadata(e)})),e.ut_metadata.fetch()),"function"!=typeof B||this.private||(e.use(B()),e.ut_pex.on("peer",(e=>{this.done||(this._debug("ut_pex: got peer: %s (from %s)",e,t),this.addPeer(e))})),e.ut_pex.on("dropped",(e=>{const i=this._peers[e];i&&!i.connected&&(this._debug("ut_pex: dropped peer: %s (from %s)",e,t),this.removePeer(e))})),e.once("close",(()=>{e.ut_pex.reset()}))),e.use(y()),this.emit("wire",e,t),this.metadata&&A((()=>{this._onWireWithMetadata(e)}))}_onWireWithMetadata(e){let t=null;const i=()=>{this.destroyed||e.destroyed||(this._numQueued>2*(this._numConns-this.numPeers)&&e.amInterested?e.destroy():(t=setTimeout(i,D),t.unref&&t.unref()))};let n;const r=()=>{if(e.peerPieces.buffer.length===this.bitfield.buffer.length){for(n=0;n{r(),this._update(),this._updateWireInterest(e)})),e.on("have",(()=>{r(),this._update(),this._updateWireInterest(e)})),e.lt_donthave.on("donthave",(()=>{r(),this._update(),this._updateWireInterest(e)})),e.once("interested",(()=>{e.unchoke()})),e.once("close",(()=>{clearTimeout(t)})),e.on("choke",(()=>{clearTimeout(t),t=setTimeout(i,D),t.unref&&t.unref()})),e.on("unchoke",(()=>{clearTimeout(t),this._update()})),e.on("request",((t,i,n,r)=>{if(n>131072)return e.destroy();this.pieces[t]||this.store.get(t,{offset:i,length:n},r)})),e.bitfield(this.bitfield),this._updateWireInterest(e),e.peerExtensions.dht&&this.client.dht&&this.client.dht.listening&&e.port(this.client.dht.address().port),"webSeed"!==e.type&&(t=setTimeout(i,D),t.unref&&t.unref()),e.isSeeder=!1,r()}_updateSelections(){this.ready&&!this.destroyed&&(A((()=>{this._gcSelections()})),this._updateInterest(),this._update())}_gcSelections(){for(let e=0;ethis._updateWireInterest(e))),e!==this._amInterested&&(this._amInterested?this.emit("interested"):this.emit("uninterested"))}_updateWireInterest(e){let t=!1;for(let i=0;i{t._updateWire(e)}),{timeout:250}):t._updateWire(e)}_updateWire(e){const t=this;if(e.peerChoking)return;if(!e.downloaded)return function(){if(e.requests.length)return;let i=t._selections.length;for(;i--;){const n=t._selections[i];let s;if("rarest"===t.strategy){const i=n.from+n.offset,a=n.to,o=a-i+1,c={};let l=0;const u=r(i,a,c);for(;l=n.from+n.offset;--s)if(e.peerPieces.get(s)&&t._request(e,s,!1))return}}();const i=V(e,.5);if(e.requests.length>=i)return;const n=V(e,1);function r(t,i,n,r){return s=>s>=t&&s<=i&&!(s in n)&&e.peerPieces.get(s)&&(!r||r(s))}function s(e){let i=e;for(let n=e;n=n)return!0;const a=function(){const i=e.downloadSpeed()||1;if(i>z)return()=>!0;const n=Math.max(1,e.requests.length)*S.BLOCK_LENGTH/i;let r=10,s=0;return e=>{if(!r||t.bitfield.get(e))return!0;let a=t.pieces[e].missing;for(;s0))return r--,!1}return!0}}();for(let o=0;o({wire:e,random:Math.random()}))).sort(((e,t)=>{const i=e.wire,n=t.wire;return i.downloadSpeed()!==n.downloadSpeed()?i.downloadSpeed()-n.downloadSpeed():i.uploadSpeed()!==n.uploadSpeed()?i.uploadSpeed()-n.uploadSpeed():i.amChoking!==n.amChoking?i.amChoking?-1:1:e.random-t.random})).map((e=>e.wire));this._rechokeOptimisticTime<=0?this._rechokeOptimisticWire=null:this._rechokeOptimisticTime-=1;let t=0;for(;e.length>0&&t0){const t=e.filter((e=>e.peerInterested));if(t.length>0){const e=t[(i=t.length,Math.random()*i|0)];e.unchoke(),this._rechokeOptimisticWire=e,this._rechokeOptimisticTime=2}}var i;e.filter((e=>e!==this._rechokeOptimisticWire)).forEach((e=>e.choke()))}_hotswap(e,t){const i=e.downloadSpeed();if(i=z||(2*o>i||o>a||(r=t,a=o))}if(!r)return!1;for(s=0;s=a)return!1;const o=n.pieces[t];let c=s?o.reserveRemaining():o.reserve();if(-1===c&&i&&n._hotswap(e,t)&&(c=s?o.reserveRemaining():o.reserve()),-1===c)return!1;let l=n._reservations[t];l||(l=n._reservations[t]=[]);let u=l.indexOf(null);-1===u&&(u=l.length),l[u]=e;const p=o.chunkOffset(c),d=s?o.chunkLengthRemaining(c):o.chunkLength(c);function f(){A((()=>{n._update()}))}return e.request(t,p,d,(function i(r,a){if(n.destroyed)return;if(!n.ready)return n.once("ready",(()=>{i(r,a)}));if(l[u]===e&&(l[u]=null),o!==n.pieces[t])return f();if(r)return n._debug("error getting piece %s (offset: %s length: %s) from %s: %s",t,p,d,`${e.remoteAddress}:${e.remotePort}`,r.message),s?o.cancelRemaining(c):o.cancel(c),void f();if(n._debug("got piece %s (offset: %s length: %s) from %s",t,p,d,`${e.remoteAddress}:${e.remotePort}`),!o.set(c,a,e))return f();const h=o.flush();I(h,(e=>{n.destroyed||(e===n._hashes[t]?(n._debug("piece verified %s",t),n.store.put(t,h,(e=>{e?n._destroy(e):(n.pieces[t]=null,n._markVerified(t),n.wires.forEach((e=>{e.have(t)})),n._checkDone()&&!n.destroyed&&n.discovery.complete(),f())}))):(n.pieces[t]=new S(o.length),n.emit("warning",new Error(`Piece ${t} failed verification`)),f()))}))})),!0}_checkDone(){if(this.destroyed)return;this.files.forEach((e=>{if(!e.done){for(let t=e._startPiece;t<=e._endPiece;++t)if(!this.bitfield.get(t))return;e.done=!0,e.emit("done"),this._debug(`file done: ${e.name}`)}}));let e=!0;for(const t of this._selections){for(let i=t.from;i<=t.to;i++)if(!this.bitfield.get(i)){e=!1;break}if(!e)break}return!this.done&&e?(this.done=!0,this._debug(`torrent done: ${this.infoHash}`),this.emit("done")):this.done=!1,this._gcSelections(),e}load(e,t){if(this.destroyed)throw new Error("torrent is destroyed");if(!this.ready)return this.once("ready",(()=>{this.load(e,t)}));Array.isArray(e)||(e=[e]),t||(t=$);const i=new x(e),n=new d(this.store,this.pieceLength);M(i,n,(e=>{if(e)return t(e);this._markAllVerified(),this._checkDone(),t(null)}))}createServer(e){if("function"!=typeof P)throw new Error("node.js-only method");if(this.destroyed)throw new Error("torrent is destroyed");const t=new P(this,e);return this._servers.push(t),t}pause(){this.destroyed||(this._debug("pause"),this.paused=!0)}resume(){this.destroyed||(this._debug("resume"),this.paused=!1,this._drain())}_debug(){const e=[].slice.call(arguments);e[0]=`[${this.client?this.client._debugId:"No Client"}] [${this._debugId}] ${e[0]}`,N(...e)}_drain(){if(this._debug("_drain numConns %s maxConns %s",this._numConns,this.client.maxConns),"function"!=typeof a.connect||this.destroyed||this.paused||this._numConns>=this.client.maxConns)return;this._debug("drain (%s queued, %s/%s peers)",this._numQueued,this.numPeers,this.client.maxConns);const e=this._queue.shift();if(!e)return;this._debug("%s connect attempt to %s",e.type,e.addr);const t=l(e.addr),i={host:t[0],port:t[1]};this.client.utp&&"utpOutgoing"===e.type?e.conn=U.connect(i.port,i.host):e.conn=a.connect(i);const n=e.conn;n.once("connect",(()=>{e.onConnect()})),n.once("error",(t=>{e.destroy(t)})),e.startConnectTimeout(),n.on("close",(()=>{if(this.destroyed)return;if(e.retries>=F.length){if(this.client.utp){const t=this._addPeer(e.addr,"tcp");t&&(t.retries=0)}else this._debug("conn %s closed: will not re-add (max %s attempts)",e.addr,F.length);return}const t=F[e.retries];this._debug("conn %s closed: will re-add to queue in %sms (attempt %s)",e.addr,t,e.retries+1);const i=setTimeout((()=>{if(this.destroyed)return;const t=l(e.addr)[0],i=this.client.utp&&this._isIPv4(t)?"utp":"tcp",n=this._addPeer(e.addr,i);n&&(n.retries=e.retries+1)}),t);i.unref&&i.unref()}))}_validAddr(e){let t;try{t=l(e)}catch(e){return!1}const i=t[0],n=t[1];return n>0&&n<65535&&!("127.0.0.1"===i&&n===this.client.torrentPort)}_isIPv4(e){return/^((?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])[.]){3}(?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])$/.test(e)}}}).call(this)}).call(this,e("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../package.json":495,"./file.js":490,"./peer.js":491,"./rarity-map.js":492,"./server.js":67,"./utp.js":67,"./webconn.js":494,_process:341,"addr-to-ip-port":3,bitfield:27,"cache-chunk-store":117,"chunk-store-stream/write":133,cpus:137,debug:161,events:193,fs:67,"fs-chunk-store":275,"immediate-chunk-store":245,lt_donthave:256,"memory-chunk-store":275,multistream:309,net:67,os:67,"parse-torrent":332,path:333,pump:349,"queue-microtask":354,"random-iterate":356,"run-parallel":381,"run-parallel-limit":380,"simple-get":394,"simple-sha1":411,speedometer:433,"torrent-discovery":477,"torrent-piece":478,ut_metadata:484,ut_pex:67}],494:[function(e,t,i){(function(i){(function(){const{default:n}=e("bitfield"),r=e("debug"),s=e("simple-get"),a=e("lt_donthave"),o=e("simple-sha1"),c=e("bittorrent-protocol"),l=r("webtorrent:webconn"),u=e("../package.json").version;t.exports=class extends c{constructor(e,t){super(),this.url=e,this.connId=e,this.webPeerId=o.sync(e),this._torrent=t,this._init()}_init(){this.setKeepAlive(!0),this.use(a()),this.once("handshake",((e,t)=>{if(this.destroyed)return;this.handshake(e,this.webPeerId);const i=this._torrent.pieces.length,r=new n(i);for(let e=0;e<=i;e++)r.set(e,!0);this.bitfield(r)})),this.once("interested",(()=>{l("interested"),this.unchoke()})),this.on("uninterested",(()=>{l("uninterested")})),this.on("choke",(()=>{l("choke")})),this.on("unchoke",(()=>{l("unchoke")})),this.on("bitfield",(()=>{l("bitfield")})),this.lt_donthave.on("donthave",(()=>{l("donthave")})),this.on("request",((e,t,i,n)=>{l("request pieceIndex=%d offset=%d length=%d",e,t,i),this.httpRequest(e,t,i,((t,i)=>{if(t){this.lt_donthave.donthave(e);const t=setTimeout((()=>{this.destroyed||this.have(e)}),1e4);t.unref&&t.unref()}n(t,i)}))}))}httpRequest(e,t,n,r){const a=e*this._torrent.pieceLength+t,o=a+n-1,c=this._torrent.files;let p;if(c.length<=1)p=[{url:this.url,start:a,end:o}];else{const e=c.filter((e=>e.offset<=o&&e.offset+e.length>a));if(e.length<1)return r(new Error("Could not find file corresponding to web seed range request"));p=e.map((e=>{const t=e.offset+e.length-1;return{url:this.url+("/"===this.url[this.url.length-1]?"":"/")+e.path,fileOffsetInRange:Math.max(e.offset-a,0),start:Math.max(a-e.offset,0),end:Math.min(t,o-e.offset)}}))}let d,f=0,h=!1;p.length>1&&(d=i.alloc(n)),p.forEach((i=>{const a=i.url,o=i.start,c=i.end;l("Requesting url=%s pieceIndex=%d offset=%d length=%d start=%d end=%d",a,e,t,n,o,c);const m={url:a,method:"GET",headers:{"user-agent":`WebTorrent/${u} (https://webtorrent.io)`,range:`bytes=${o}-${c}`},timeout:6e4};function b(e,t){if(e.statusCode<200||e.statusCode>=300){if(h)return;return h=!0,r(new Error(`Unexpected HTTP status code ${e.statusCode}`))}l("Got data of length %d",t.length),1===p.length?r(null,t):(t.copy(d,i.fileOffsetInRange),++f===p.length&&r(null,d))}s.concat(m,((e,t,i)=>{if(!h)return e?"undefined"==typeof window||a.startsWith(`${window.location.origin}/`)?(h=!0,r(e)):s.head(a,((t,i)=>{if(!h){if(t)return h=!0,r(t);if(i.statusCode<200||i.statusCode>=300)return h=!0,r(new Error(`Unexpected HTTP status code ${i.statusCode}`));if(i.url===a)return h=!0,r(e);m.url=i.url,s.concat(m,((e,t,i)=>{if(!h)return e?(h=!0,r(e)):void b(t,i)}))}})):void b(t,i)}))}))}destroy(){super.destroy(),this._torrent=null}}}).call(this)}).call(this,e("buffer").Buffer)},{"../package.json":495,bitfield:27,"bittorrent-protocol":28,buffer:110,debug:161,lt_donthave:256,"simple-get":394,"simple-sha1":411}],495:[function(e,t,i){t.exports={version:"1.5.8"}},{}],496:[function(e,t,i){t.exports=function e(t,i){if(t&&i)return e(t)(i);if("function"!=typeof t)throw new TypeError("need wrapper function");return Object.keys(t).forEach((function(e){n[e]=t[e]})),n;function n(){for(var e=new Array(arguments.length),i=0;i1080?(q.setProps({placement:"right"}),N.setProps({placement:"right"}),D.setProps({placement:"right"})):(q.setProps({placement:"top"}),N.setProps({placement:"top"}),D.setProps({placement:"top"}))}function W(e){Y();try{console.info("Attempting parse"),p=r(e),V(),p.xs&&(console.info("Magnet includes xs, attempting remote parse"),K(p.xs))}catch(t){console.warn(t),"magnet"==u?(console.info("Attempting remote parse"),K(e)):(H.error("Problem parsing input. Is this a .torrent file?"),console.error("Problem parsing input"))}}function K(e){r.remote(e,(function(e,t){if(e)return H.error("Problem remotely fetching that file or parsing result"),console.warn(e),void Y();u="remote-torrent-file",v.innerHTML='',g.setContent("Currently loaded information sourced from remotely fetched Torrent file"),p=t,V()}))}function V(){if(console.log(p),E.value=p.infoHash,y.value=p.name?p.name:"",p.created?(x.value=p.created.toISOString().slice(0,19),x.type="datetime-local"):x.type="text",w.value=p.createdBy?"by "+p.createdBy:"",k.value=p.comment?p.comment:"",j.innerHTML="",p.announce&&p.announce.length)for(let e=0;e',n.addEventListener("click",Q),t.appendChild(n),j.appendChild(t)}if(I.innerHTML="",p.urlList&&p.urlList.length)for(let e=0;e',n.addEventListener("click",Q),t.appendChild(n),I.appendChild(t)}if(B.innerHTML="",p.files&&p.files.length){if(R.style.display="none",p.files.length<100)for(let e of p.files){let t=G(o.lookup(e.name));B.appendChild($(t,e.name,e.length))}else{for(let e=0;e<100;e++){let t=G(o.lookup(p.files[e].name));B.appendChild($(t,p.files[e].name,p.files[e].length))}B.appendChild($("","...and another "+(p.files.length-100)+" more files",""))}B.appendChild($("folder-tree","",p.length)),D.setContent("Download Torrent file"),U.addEventListener("click",ne),U.disabled=!1}else z.torrents.length>0?(R.style.display="none",B.innerHTML=''):(R.style.display="block",B.innerHTML=''),D.setContent("Files metadata is required to generate a Torrent file. Try fetching files list from WebTorrent."),U.removeEventListener("click",ne),U.disabled=!0;L.setAttribute("data-clipboard-text",window.location.origin+"#"+r.toMagnetURI(p)),O.setAttribute("data-clipboard-text",r.toMagnetURI(p)),d.style.display="none",b.style.display="flex",window.location.hash=r.toMagnetURI(p),p.name?document.title="Torrent Parts | "+p.name:document.title="Torrent Parts | Inspect and edit what's in your Torrent file or Magnet link",g.enable(),gtag("event","view_item",{items:[{item_id:p.infoHash,item_name:p.name,item_category:u}]})}function $(e,t,i){let n=document.createElement("tr"),r=document.createElement("td");e&&(r.innerHTML=''),n.appendChild(r);let s=document.createElement("td");s.innerHTML=t,n.appendChild(s);let o=document.createElement("td");return o.innerHTML=a.format(i,{decimalPlaces:1,unitSeparator:" "}),n.appendChild(o),n}function G(e){if(!e)return"file";switch(!0){case e.includes("msword"):case e.includes("wordprocessingml"):case e.includes("opendocument.text"):case e.includes("abiword"):return"file-word";case e.includes("ms-excel"):case e.includes("spreadsheet"):case e.includes("powerpoint"):case e.includes("presentation"):return"file-powerpoint";case e.includes("7z-"):case e.includes("iso9660"):case e.includes("zip"):case e.includes("octet-stream"):return"file-archive";case e.includes("csv"):return"file-csv";case e.includes("pdf"):return"file-pdf";case e.includes("font"):return"file-contract";case e.includes("text"):case e.includes("subrip"):case e.includes("vtt"):return"file-alt";case e.includes("audio"):return"file-audio";case e.includes("image"):return"file-image";case e.includes("video"):return"file-video";default:return"file"}}function X(e){this.dataset.group?p[this.dataset.group][this.dataset.index]=this.value?this.value:"":p[this.id]=this.value?this.value:"",window.location.hash=r.toMagnetURI(p),te()}function Y(){document.getElementById("magnet").value="",document.getElementById("torrent").value="",d.style.display="flex",b.style.display="none",y.value="",x.value="",w.value="",k.value="",E.value="",j.innerHTML="",I.innerHTML="",z.torrents.forEach((e=>e.destroy())),R.style.display="block",B.innerHTML="",window.location.hash="",L.setAttribute("data-clipboard-text",""),O.setAttribute("data-clipboard-text",""),document.title="Torrent Parts | Inspect and edit what's in your Torrent file or Magnet link",g.disable(),gtag("event","reset")}async function Z(){S.className="disabled",S.innerHTML="Adding...";try{let e=await fetch("https://newtrackon.com/api/stable"),t=await e.text();p.announce=p.announce.concat(t.split("\n\n")),p.announce.push("http://bt1.archive.org:6969/announce"),p.announce.push("http://bt2.archive.org:6969/announce"),p.announce=p.announce.filter(((e,t)=>e&&p.announce.indexOf(e)===t)),H.success("Added known working trackers from newTrackon"),te()}catch(e){H.error("Problem fetching trackers from newTrackon"),console.warn(e)}S.className="",S.innerHTML="Add Known Working Trackers",V(),gtag("event","add_trackers")}function J(){p[this.dataset.type].unshift(""),V()}function Q(){p[this.parentElement.className].splice(this.parentElement.dataset.index,1),V()}function ee(e){p[e]=[],te(),V()}function te(){p.created=new Date,p.createdBy="Torrent Parts ",p.created?(x.value=p.created.toISOString().slice(0,19),x.type="datetime-local"):x.type="text",w.value=p.createdBy?"by "+p.createdBy:""}function ie(){console.info("Attempting fetching files from Webtorrent..."),R.style.display="none",p.announce.push("wss://tracker.webtorrent.io"),p.announce.push("wss://tracker.openwebtorrent.com"),p.announce.push("wss://tracker.btorrent.xyz"),p.announce.push("wss://tracker.fastcast.nz"),p.announce=p.announce.filter(((e,t)=>e&&p.announce.indexOf(e)===t)),z.add(r.toMagnetURI(p),(e=>{p.info=Object.assign({},e.info),p.files=e.files,p.infoBuffer=e.infoBuffer,p.length=e.length,p.lastPieceLength=e.lastPieceLength,te(),V(),H.success("Fetched file details from Webtorrent peers"),e.destroy()})),V(),gtag("event","attempt_webtorrent_fetch")}function ne(){let e=r.toTorrentFile(p);if(null!==e&&navigator.msSaveBlob)return navigator.msSaveBlob(new Blob([e],{type:"application/x-bittorrent"}),p.name+".torrent");let t=document.createElement("a");t.style.display="none";let i=window.URL.createObjectURL(new Blob([e],{type:"application/x-bittorrent"}));t.setAttribute("href",i),t.setAttribute("download",p.name+".torrent"),document.body.appendChild(t),t.click(),window.URL.revokeObjectURL(i),t.remove(),gtag("event","share",{method:"Torrent Download",content_id:p.name})}window.addEventListener("resize",F),F(),document.addEventListener("DOMContentLoaded",(function(){document.getElementById("magnet").addEventListener("keyup",(function(e){e.preventDefault(),"Enter"===e.key&&(u="magnet",v.innerHTML='',g.setContent("Currently loaded information sourced from Magnet URL"),W(magnet.value))})),document.getElementById("torrent").addEventListener("change",(function(e){e.preventDefault(),e.target.files[0].arrayBuffer().then((function(e){u="torrent-file",v.innerHTML='',g.setContent("Currently loaded information sourced from Torrent file"),W(s.from(e))}))})),document.addEventListener("dragover",(function(e){e.preventDefault()})),document.addEventListener("drop",(function(e){e.preventDefault(),e.dataTransfer.items[0].getAsFile().arrayBuffer().then((function(e){u="torrent-file",v.innerHTML='',g.setContent("Currently loaded information sourced from Torrent file"),W(s.from(e))}))})),f.addEventListener("click",(function(e){e.preventDefault(),H.success("Parsing Ubuntu 20.04 Magnet URL"),W("magnet:?xt=urn:btih:9fc20b9e98ea98b4a35e6223041a5ef94ea27809&dn=ubuntu-20.04-desktop-amd64.iso&tr=https%3A%2F%2Ftorrent.ubuntu.com%2Fannounce&tr=https%3A%2F%2Fipv6.torrent.ubuntu.com%2Fannounce")})),h.addEventListener("click",(async function(e){e.preventDefault(),H.success("Fetching and Parsing “The WIRED CD” Torrent File..."),K("https://webtorrent.io/torrents/wired-cd.torrent")})),m.addEventListener("click",(async function(e){e.preventDefault(),H.success("Parsing Jack Johnson Archive.org Torrent File");let t=await fetch("/ext/jj2008-06-14.mk4_archive.torrent"),i=await t.arrayBuffer();W(s.from(i))}));let e=new n("#copyURL");e.on("success",(function(e){H.success("Copied site URL to clipboard!"),console.info(e),gtag("event","share",{method:"Copy URL",content_id:e.text})})),e.on("failure",(function(e){H.error("Problem copying to clipboard"),console.warn(e)}));let t=new n("#copyMagnet");t.on("success",(function(e){H.success("Copied Magnet URL to clipboard!"),gtag("event","share",{method:"Copy Magnet",content_id:e.text})})),t.on("failure",(function(e){H.error("Problem copying to clipboard"),console.warn(e)})),y.addEventListener("input",X),y.addEventListener("change",X),y.addEventListener("reset",X),y.addEventListener("paste",X),_.addEventListener("click",Y),k.addEventListener("input",X),k.addEventListener("change",X),k.addEventListener("reset",X),k.addEventListener("paste",X),S.addEventListener("click",Z),M.addEventListener("click",J),A.addEventListener("click",(()=>ee("announce"))),T.addEventListener("click",J),C.addEventListener("click",(()=>ee("urlList"))),R.addEventListener("click",ie),l("[data-tippy-content]",{theme:"torrent-parts",animation:"shift-away-subtle"}),g.disable(),window.location.hash&&(u="shared-url",v.innerHTML='',g.setContent("Currently loaded information sourced from shared torrent.parts link"),W(window.location.hash.split("#")[1]))}))},{Buffer:2,bytes:116,clipboard:135,"mime-types":280,"parse-torrent":332,"tippy.js":475,webtorrent:488}]},{},[498]); \ No newline at end of file diff --git a/package.json b/package.json index 702fb72..554e42a 100644 --- a/package.json +++ b/package.json @@ -6,19 +6,19 @@ "dependencies": { "browserify": "^17.0.0", "bytes": "^3.1.0", - "clipboard": "^2.0.6", + "clipboard": "^2.0.8", "magnet-uri": "^6.2.0", - "mime-types": "^2.1.27", - "parse-torrent": "^9.0.0", - "tippy.js": "^6.2.7", - "webtorrent": "^1.0.0" + "mime-types": "^2.1.33", + "parse-torrent": "^9.1.4", + "tippy.js": "^6.3.3", + "webtorrent": "^1.5.8" }, "devDependencies": { - "buffer": "^5.2.1", - "Buffer": "^0.0.0", - "notyf": "^3.9.0", - "terser": "^5.3.8", - "watchify": "^3.11.1" + "Buffer": "0.0.0", + "buffer": "^6.0.3", + "notyf": "^3.10.0", + "terser": "^5.9.0", + "watchify": "^4.0.0" }, "scripts": { "watch": "watchify src/parse.js -o bin/bundle.js", diff --git a/src/style.css b/src/style.css index 507d068..5ee55e7 100644 --- a/src/style.css +++ b/src/style.css @@ -1,8 +1,8 @@ /*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */ html{line-height:1.15;-webkit-text-size-adjust:100%}body{margin:0}main{display:block}h1{font-size:2em;margin:.67em 0}hr{box-sizing:content-box;height:0;overflow:visible}pre{font-family:monospace,monospace;font-size:1em}a{background-color:transparent}abbr[title]{border-bottom:none;text-decoration:underline;text-decoration:underline dotted}b,strong{font-weight:bolder}code,kbd,samp{font-family:monospace,monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}img{border-style:none}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;line-height:1.15;margin:0}button,input{overflow:visible}button,select{text-transform:none}[type=button],[type=reset],[type=submit],button{-webkit-appearance:button}[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner,button::-moz-focus-inner{border-style:none;padding:0}[type=button]:-moz-focusring,[type=reset]:-moz-focusring,[type=submit]:-moz-focusring,button:-moz-focusring{outline:1px dotted ButtonText}fieldset{padding:.35em .75em .625em}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal}progress{vertical-align:baseline}textarea{overflow:auto}[type=checkbox],[type=radio]{box-sizing:border-box;padding:0}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}details{display:block}summary{display:list-item}template{display:none}[hidden]{display:none} -/*! Tippy v6.3.1 | MIT License | github.com/atomiks/tippyjs */ -.tippy-box[data-animation=fade][data-state=hidden]{opacity:0}[data-tippy-root]{max-width:calc(100vw - 10px)}.tippy-box{position:relative;background-color:#333;color:#fff;border-radius:4px;font-size:14px;line-height:1.4;outline:0;transition-property:transform,visibility,opacity}.tippy-box[data-placement^=top]>.tippy-arrow{bottom:0}.tippy-box[data-placement^=top]>.tippy-arrow:before{bottom:-7px;left:0;border-width:8px 8px 0;border-top-color:initial;transform-origin:center top}.tippy-box[data-placement^=bottom]>.tippy-arrow{top:0}.tippy-box[data-placement^=bottom]>.tippy-arrow:before{top:-7px;left:0;border-width:0 8px 8px;border-bottom-color:initial;transform-origin:center bottom}.tippy-box[data-placement^=left]>.tippy-arrow{right:0}.tippy-box[data-placement^=left]>.tippy-arrow:before{border-width:8px 0 8px 8px;border-left-color:initial;right:-7px;transform-origin:center left}.tippy-box[data-placement^=right]>.tippy-arrow{left:0}.tippy-box[data-placement^=right]>.tippy-arrow:before{left:-7px;border-width:8px 8px 8px 0;border-right-color:initial;transform-origin:center right}.tippy-box[data-inertia][data-state=visible]{transition-timing-function:cubic-bezier(.54,1.5,.38,1.11)}.tippy-arrow{width:16px;height:16px;color:#333}.tippy-arrow:before{content:"";position:absolute;border-color:transparent;border-style:solid}.tippy-content{position:relative;padding:5px 9px;z-index:1} +/*! Tippy v6.3.3 | MIT License | github.com/atomiks/tippyjs */ +.tippy-box[data-animation=fade][data-state=hidden]{opacity:0}[data-tippy-root]{max-width:calc(100vw - 10px)}.tippy-box{position:relative;background-color:#333;color:#fff;border-radius:4px;font-size:14px;line-height:1.4;white-space:normal;outline:0;transition-property:transform,visibility,opacity}.tippy-box[data-placement^=top]>.tippy-arrow{bottom:0}.tippy-box[data-placement^=top]>.tippy-arrow:before{bottom:-7px;left:0;border-width:8px 8px 0;border-top-color:initial;transform-origin:center top}.tippy-box[data-placement^=bottom]>.tippy-arrow{top:0}.tippy-box[data-placement^=bottom]>.tippy-arrow:before{top:-7px;left:0;border-width:0 8px 8px;border-bottom-color:initial;transform-origin:center bottom}.tippy-box[data-placement^=left]>.tippy-arrow{right:0}.tippy-box[data-placement^=left]>.tippy-arrow:before{border-width:8px 0 8px 8px;border-left-color:initial;right:-7px;transform-origin:center left}.tippy-box[data-placement^=right]>.tippy-arrow{left:0}.tippy-box[data-placement^=right]>.tippy-arrow:before{left:-7px;border-width:8px 8px 8px 0;border-right-color:initial;transform-origin:center right}.tippy-box[data-inertia][data-state=visible]{transition-timing-function:cubic-bezier(.54,1.5,.38,1.11)}.tippy-arrow{width:16px;height:16px;color:#333}.tippy-arrow:before{content:"";position:absolute;border-color:transparent;border-style:solid}.tippy-content{position:relative;padding:5px 9px;z-index:1} /* Tippy shift-away-subtle theme */ .tippy-box[data-animation=shift-away-subtle][data-state=hidden]{opacity:0}.tippy-box[data-animation=shift-away-subtle][data-state=hidden][data-placement^=top]{transform:translateY(5px)}.tippy-box[data-animation=shift-away-subtle][data-state=hidden][data-placement^=bottom]{transform:translateY(-5px)}.tippy-box[data-animation=shift-away-subtle][data-state=hidden][data-placement^=left]{transform:translateX(5px)}.tippy-box[data-animation=shift-away-subtle][data-state=hidden][data-placement^=right]{transform:translateX(-5px)}